<!DOCTYPE html>
<html>
<head>
<title>表格</title>
<meta charset="utf-8">
<style type="text/css">
thead {color:blue;}
tbody {color:red;height: 50px}
caption{color:green;}
</style>
</head>
<body>
<table border="1" width="50%" align="center">
<!--border用来设置表格线宽宽度-->
<caption>鱼C表</caption><!--作为标题,只能有一个-->
<thead align="center">
<tr>
<td colspan="2">鱼C信息表</td>
<!--colspan的值就是合并几个单元格的意思-->
</tr>
<tr>
<th>姓名</th><!--th用做二级标题-->
<th>年龄</th>
</tr>
</thead>
<tbody align="center">
<tr><!--tr,代表一行表格-->
<td>小甲鱼老师:</td>
<td>28</td><!--td,代表单元格-->
</tr>
<tr>
<td>不二如是:</td>
<td>18</td>
</tr>
</tbody>
<!--为了区分表头和表格内容,使用thead、tbody类似区块-->
</table>
</body>
</html>
|