码迷,mamicode.com
首页 > 其他好文 > 详细

给table加边框的两种方法

时间:2014-10-10 17:02:14      阅读:157      评论:0      收藏:0      [点我收藏+]

标签:style   color   sp   html   ad   htm   as   type   table   

<!DOCTYPE html>
<html>
<head>
<style>
.a {
border-spacing: 1px;
background-color: #ccc;
}
.a td, .a th {
background-color: #fff;
}
.b {
border-collapse:collapse;
}
.b td, .b th {
border:1px solid #aaa;
}
</style>
</head>

<body>
<table class="a">
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>Peter</td>
<td>Griffin</td>
</tr>
<tr>
<td>Lois</td>
<td>Griffin</td>
</tr>
</table>
<br />
<table class="b">
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>Peter</td>
<td>Griffin</td>
</tr>
<tr>
<td>Lois</td>
<td>Griffin</td>
</tr>
</table>
</body>
</html>

给table加边框的两种方法

标签:style   color   sp   html   ad   htm   as   type   table   

原文地址:http://www.cnblogs.com/iloveyou-sky/p/4016123.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!