有时候我们也需要插入表格来展示一些数据,表格的制作稍微有点麻烦,不过用Sublime Text 3它可以十分轻松的创建表格。表格一般由表头,表的标题,表的内容组成。最常用的就是Table标签了。
<!-- 表格边框1px,单元格边距5px,单元格间距10px,背景颜色灰色,背景图片1.jpg-->
<table border="1" cellpadding="5" cellspacing="10" bgcolor="gray" background='1.jpg'>
<col bgcolor='red'/> <!-- 设置表格列的属性 -->
<colgroup bgcolor='blue'></colgroup> <!-- 设置表格列组的属性 -->
<caption>表格标题</caption>
<!-- 页眉 -->
<thead>
<tr> <!-- 表格的行 -->
<th colspan="2">1--one</th> <!-- 表格表头,相当于列 跨两行 -->
<th>2--two</th>
<th>3--three</th>
<th>4--four</th>
</tr>
</thead>
<!-- 表格主体 -->
<tbody>
<tr>
<td>a</td> <!-- 表格单元 -->
<td>b</td>
<td>c</td>
<td>d</td>
</tr>
</tbody>
<!-- 表格页脚 -->
<tfoot>
<tr>
<td>h</td>
<td>j</td>
<td>k</td>
<td>l</td>
</tr>
</tfoot>
</table>

如需转载,请注明文章出处和来源网址:http://www.divcss5.com/html/h59583.shtml