Prefer to wrap <tr> inside <tbody>

Rule ID:
prefer-tbody
Category:
Style
Standards:
-
Fixable:
No

While <tbody> is optional is relays semantic information about its contents.

Where applicable it should also be combined with <thead> and <tfoot>.

Rule details

Examples of incorrect code for this rule:

<table>
  <tr>
    <td>...</td>
  </tr>
</table>
error: Prefer to wrap <tr> elements in <tbody> (prefer-tbody)
  1 | <table>
> 2 |   <tr>
    |    ^^
  3 |     <td>...</td>
  4 |   </tr>
  5 | </table>


1 error found.

Examples of correct code for this rule:

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