Search code examples
htmlvalidationaccessibility

Does a <tr> have to be inside a <tbody>


Does a table row (<tr>) have to be in a table body (<tbody>), if the table has a table body, or can it exist outside of the table body?

<table>
    <tr>
      <td colspan='2'>...</td>
    </tr>

    <tbody>
      <tr>
        <td>...</td>
        <td>...</td>
      </tr>
    </tbody>

    <tr>
      <td colspan='2'>...</td>
    </tr>

    <tbody>
      <tr>
        <td>...</td>
        <td>...</td>
      </tr>
    </tbody>

</table>

Solution

  • No, the <tr> can be in the <thead>, <tbody>, <tfoot> or it doesn't have to be in any of them.