tbody HTML tag - HTML Table Body

HTML tables can contain a header (thead), a body section and a footer (tfoot). We need to define where the table's body section starts with the opening <tbody> tag and ending it with the </tbody> closing tag.

Syntax

<table>
  <tbody>
    <tr>
      <td>Cell 1</td>
      <td>Cell 2</td>
    </tr>
  </tbody>
</table>

We need to add the tbody tag to our HTML table only if it contains a header, a footer, or both.
We don't need to define the <tbody>...</tbody> section if the HTML table contains only cells, without header or footer.

<table>
  <thead>
    <tr>
      <th>Model</th>
      <th>Price</th>
      <th>Range</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Model 3</td>
      <td>42,900</td>
      <td>272</td>
    </tr>
    <tr>
      <td>Model Y</td>
      <td>54,990</td>
      <td>330</td>
    </tr>
  </tbody>
  <tfoot>
    <tr>
      <td></td>
      <td>USD</td>
      <td>miles</td>
    </tr>
  </tfoot>
</table>
Model Price Range
Model 3 42,900 272
Model Y 54,990 330
USD miles

A simple HTML table with header, body and footer sections.

tbody Is Not Mandatory

<table>
  <tr>
    <td>Model 3</td>
    <td>$42,900</td>
  </tr>
  <tr>
    <td>Model Y</td>
    <td>$54,990</td>
  </tr>
</table>
Model 3  $42,900
Model Y  $54,990

The tbody tag is negligible if there's no header or footer.

Tips And Tricks

tbody Generator

The online table generator adds the <tbody> tag if there's a header or a footer defined.

2 × 2

Table

Style Name
Georgia
Georgia
Palatino
Times New Roman
Arial
Arial Black
Comic Sans
Impact
Lucida Sans
Tahoma
Trebuchet
Verdana
Courier
Lucida Console
Left Center Right
px
px

Body

Left Center Right

HTML
Preview Apply »
HTML Copy
CSS « Apply