下面的code是HTML tables?的语义使用
<table>
<tbody>
<tr>
<th>Phone</th>
<td>+1234567</td>
</tr>
<tr>
<th>Email</th>
<td><a href="mailto:name@example.com">name@example.com</a></td>
</tr>
<tr>
<th>Fax</th>
<td>+1234568</td>
</tr>
</tbody>
</table>
未格式化,它看起来像这样:
对我来说似乎是表格数据。 (因此,不仅用于布局——尽管副作用是它有助于拥有相等的列。)
最佳答案
如果您将联系人输入 <table>
仅用于布局目的,那么您最好使用 css 样式 <dl>
.标识符将进入 <dt>
s 和 <dd>
中的数据
但是如果你实际上输出的是一个包含多个联系人的表格,那么<table>
将是要使用的正确元素。不要忘记使用 <th>
s 代表标识符和 <td>
s 为数据。
关于html - <table> 是用于显示电话、电子邮件和传真的语义吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14461265/