在HTML中如何创建表头?
使用HTML中的<thead>标记创建表头。HTML<thead>标记用于将标题添加到表中。thead标签与tbody标签和tfoot标签一起使用,以确定表的每个部分(页眉,页脚,正文)。
HTML<thead>标记还支持以下附加属性-
left
center
justify
char
middle
bottom
baseline
示例
您可以尝试运行以下代码以了解如何在HTML中实现<thead>标记-
<!DOCTYPE html>
<html>
<head>
<title>HTML thead Tag</title>
</head>
<body>
<table style = "width:100%" border = "1">
<thead>
<tr>
<td colspan = "4">This is the head of the table</td>
</tr>
</thead>
<tfoot>
<tr>
<td colspan = "4">This is the foot of the table</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
<td>Cell 3</td>
<td>Cell 4</td>
</tr>
<tr>
...more rows here containing four cells...
</tr>
</tbody>
<tbody>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
<td>Cell 3</td>
<td>Cell 4</td>
</tr>
<tr>
...more rows here containing four cells...
</tr>
</tbody>
</table>
</body>
</html>热门推荐
10 病人祝福语老师寄语简短
11 新娘生孩子祝福语简短
12 婆婆66岁祝福语简短
13 今天孩子高考祝福语简短
14 送彩票生日祝福语简短
15 分别祝福语简短情话英文
16 画室揭牌仪式祝福语简短
17 女友妈妈生日祝福语简短
18 离别赠言离职祝福语简短