在HTML语义之后,将工具栏添加到表中



我有一个基本的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>

imho,由于工具栏与表格数据有关,因此我看到该工具栏在thead中连续存在的语义问题。

最新更新