1、表格构成的三个基本要素 table:表格的外框、范围,用来定义表格;tr:表格的行;td:表格的单元格
2、th元素:为表格添加单元格,是tr的子元素
3、colspan:横向合并单元格,语法为<td><colspan>="3"</td>
4、rowspan:竖向合并单元格,语法为<td><rowspan>="3"</td>
5、caption元素:给表格添加标题,是table的子元素,caption的align属性可以设置标题位置。不过一般用css设置标题位置
6、thead\tfoot\tbody元素:表头、页脚、主体。一般结合css、java来使用
7、colgroup元素
用来组合列,她的span属性可以设置组合列的数目;它可以包含一个子元素 col.
为table的子元素,必须放在caption元素之后,thead元素之前
8、col元素
col可以用来设定列的属性;它可以使用span属性
col一般作为colgroup元素的子元素配合使用
<!DOCTYPE html>
< html lang="zh-cn">
<head>
<meta charset="UTF-8">
<title>例5</title>
</head>
<body bgcolor=”#fedcbd“>
<table border=“2” align=“center” style=“font-size:18px;”>
<colgroup span=”4“>
<col span=“1” style=“width:150px;background=blue”>
<col span=“2” style=“width:200px;background=red”>
<col span=“1” style=“width:150px;background=green”>
</colgroup>
<caption style="font-size:30px;color:yellow">特殊符号的使用</caption>
<thead>
<tr style="height:50px;background=yellow;"> <th>符号</th><th>实体名称</th><th>实体数量</th><th>描述</th></tr>
</thead>
<tbody>
<tr align="center"> <td></td><td>&nbsp</td><td>&#160</td><td>空格</td></tr>
<tr align="center"> <td><</td><td><</td><td>&lt#60</td><td>小于</td></tr>
<tr align="center"> <td>></td><td>></td><td>&gt#62</td><td>大于</td></tr>
<tr align="center"> <td>&</td><td>&amp</td><td>&#38</td><td>连接符号</td></tr>
<tr align="center"> <td>“</td><td>"</td><td>&#34</td><td>双引号</td></tr>
<tr align="center"> <td>±</td><td>±</td><td>&#177</td><td>正负值</td></tr>
<tr align="center"> <td>©</td><td>©</td><td>&#169</td><td>著作权</td></tr>
<tr align="center"> <td>℗</td><td>®</td><td>&#174</td><td>商标</td></tr>
</tbody>
<tfoot>
<tr > <td colspan=”4“ style=”height:40px;background:yellow“>其他的用到时查询即可知</td></tr>
</tfoot>
</table>
</body>
</html>