如何制作一个垂直列中包含标题的HTML表格?
问题描述:
我想制作一个HTML文件,其中包含一个垂直列中的标题和右侧列中的数据。总共只有2列。我已经看过html文档并看到了有关范围的东西,但我不完全确定如何在此上下文中使用它。例如:如何制作一个垂直列中包含标题的HTML表格?
谢谢:)
的HTML是相当简单的,只是一定要使用[scope]
attribute指定表的正确方向。
<table>
<tbody>
<tr>
<th scope="row">City</th>
<td>$city</td>
</tr>
<tr>
<th scope="row">Latitude</th>
<td>$latitude</td>
</tr>
<tr>
<th scope="row">Longitude</th>
<td>$longitude</td>
</tr>
<tr>
<th scope="row">Country</th>
<td>$country</td>
</tr>
</tbody>
</table>
从文档的属性[scope]
:
的行状态表示头单元适用于一些相同的行(多个)在随后的细胞。
您可以创建与元素,像这样进行元素的表:
<table>
<tr>
<th scope="row">Category 1</th><td>data1</td>
</tr>
<tr>
<th scope="row">Category 2</th><td>data2</td>
</tr>
<tr>
<th scope="row">Category 3</th><td>data3</td>
</tr>
这里是它在行动的例子:
答
的HTML是相当简单的,只是一定要使用[scope]
attribute指定表的正确方向。
<table>
<tbody>
<tr>
<th scope="row">City</th>
<td>$city</td>
</tr>
<tr>
<th scope="row">Latitude</th>
<td>$latitude</td>
</tr>
<tr>
<th scope="row">Longitude</th>
<td>$longitude</td>
</tr>
<tr>
<th scope="row">Country</th>
<td>$country</td>
</tr>
</tbody>
</table>
从文档的属性[scope]
:
的行状态表示头单元适用于一些相同的行(多个)在随后的细胞。
答
您可以创建与元素,像这样进行元素的表:
<table>
<tr>
<th scope="row">Category 1</th><td>data1</td>
</tr>
<tr>
<th scope="row">Category 2</th><td>data2</td>
</tr>
<tr>
<th scope="row">Category 3</th><td>data3</td>
</tr>
这里是它在行动的例子:
他们有要成为
回答
的HTML是相当简单的,只是一定要使用
[scope]
attribute指定表的正确方向。从文档的属性
[scope]
:您可以创建与元素,像这样进行元素的表:
这里是它在行动的例子:
vertical headers
相关问题