常用属性:
border:设置外围框的大小。
frame:设置边框的显示方式(枚举选项)。
Cell padding :设置cell内容与边框之间空白的大小。(内补丁)
Cell spacing :设置cell边框的大小。
cellpadding="10" | Row |
Second | Row |
cellspacing="10" | Row |
Second | Row |
表格标签
表格 | 描述 |
---|---|
<table> | 定义表格 |
<caption> | 定义表格标题。 |
<th> | 定义表格的表头。 |
<tr> | 定义表格的行。 |
<td> | 定义表格单元。 |
<thead> | 定义表格的页眉。 |
<tbody> | 定义表格的主体。 |
<tfoot> | 定义表格的页脚。 |
<col> | 定义用于表格列的属性。 |
<colgroup> | 定义表格列的组。配合<col>可分组定义column的样式。 |
<table border="1" frame="box" cellpadding="5" cellspacing="5">
<caption>
this is caption</caption>
<colgroup>
<!--下面的表格未必能体现出来,IE可以很好地支持,FF不支持color-->
<col style="width: 50px; color: Red" />
<col style="width: 80px; color: Blue;" />
<col style="width: 110px; color: Gray;" />
<col style="width: 150px; color: Green;" />
</colgroup>
<tfoot>
<tr>
<td colspan="4">
this is tfoot
</td>
</tr>
</tfoot>
<thead>
<tr>
<th>
thead
</th>
<th>
thead
</th>
<th>
thead
</th>
<th>
thead
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
tbody1
</td>
<td>
tbody2
</td>
<td>
tbody3
</td>
<td rowspan="2">
tbody4
</td>
</tr>
<tr>
<td>
tbody1
</td>
<td>
tbody2
</td>
<td>
tbody3
</td>
</tr>
</tbody>
</table>
this is tfoot | |||
thead | thead | thead | thead |
---|---|---|---|
tbody1 | tbody2 | tbody3 | tbody4 |
tbody1 | tbody2 | tbody3 |