HTML 的表格(Table)使用 <table>
标签标记。
表格头使用 <thead>
标签
表格主体使用 <tbody>
标签
表格的行使用 <tr>
(Table Row)标签
表头单元格使用 <th>
(Table Head)标签
普通单元格使用 <td>
(Table Data)标签。
<table border="1">
<thead>
<tr>
<th scope="col">序号</th> <!-- 行表头 -->
<th scope="col">标签</th> <!-- 行表头 -->
<th scope="col">说明</th> <!-- 行表头 -->
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th> <!-- 列表头 -->
<td>table</td>
<td>标记表格</td>
</tr>
<tr>
<th scope="row">2</th> <!-- 列表头 -->
<td>tr</td>
<td>标记表格的行</td>
</tr>
<tr>
<th scope="row">3</th> <!-- 列表头 -->
<td>th</td>
<td>标记表头的单元格</td>
</tr>
<tr>
<th scope="row">4</th> <!-- 列表头 -->
<td>td</td>
<td>标记表的普通单元格</td>
</tr>
</tbody>
</table>