【问题标题】:Adding a toolbar to a table following HTML semantics按照 HTML 语义向表格添加工具栏
【发布时间】:2012-10-18 16:37:09
【问题描述】:

我有一个基本的 HTML 表格,如下所示:

<table>
  <thead>
    <tr>
      <th></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td></td>
      <td></td>
    </tr>
  </tbody>
</table>

我想在它上面添加一个工具栏。在thead 中将工具栏作为一行添加在语义上是否可以接受?

<table>
  <thead>
    <tr>
      <th colspan="2">
        <!-- toolbar buttons -->
      </th>
    </tr>
    <tr>
      <th></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td></td>
      <td></td>
    </tr>
  </tbody>
</table>

【问题讨论】:

  • 你为什么首先使用表格?
  • 工具栏按钮是否与表格中的数据相关?
  • Diodeus,我正在显示表格数据。
  • Kevin,是的,工具栏按钮与表格的内容直接相关。

标签: html markup semantic-web semantic-markup


【解决方案1】:

恕我直言,由于工具栏与表格数据相关,因此我认为在 thead 中将该工具栏排成一行没有语义问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-03-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多