Search code examples
htmlmarkupsemantic-websemantic-markup

Adding a toolbar to a table following HTML semantics


I have a basic HTML table like so:

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

I want to add a toolbar above it. Would it be semantically acceptable to add a toolbar as a row in the 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>

Solution

  • IMHO, since the toolbar is related to the tabular data, I see no semantic issue with having that toolbar live in a row in the thead.