**`<tbody>`** contains the primary data rows of a table, separate from `<thead>` (headers) and `<tfoot>` (summary rows). A single table can even contain **multiple `<tbody>` elements** to group logically related sets of rows (for example, transactions grouped by month), each rendered continuously but semantically separable — useful for styling or scripting distinct groups differently.
1Understanding <tbody>
`<tbody>` contains the primary data rows of a table, separate from <thead> (headers) and <tfoot> (summary rows). A single table can even contain multiple `<tbody>` elements to group logically related sets of rows (for example, transactions grouped by month), each rendered continuously but semantically separable — useful for styling or scripting distinct groups differently.
If you don't explicitly write <thead>/<tbody>/<tfoot>, browsers implicitly wrap your plain <tr> rows in an anonymous <tbody> anyway — writing it explicitly just makes that structure visible and stylable in your markup.
<table>
<thead><tr><th>Month</th><th>Sales</th></tr></thead>
<tbody>
<tr><td>Jan</td><td>$5,000</td></tr>
<tr><td>Feb</td><td>$6,200</td></tr>
</tbody>
</table>2Practical Example
Here is a real-world application of <tbody> showing how it is used in production HTML.
<!-- Multiple tbody groups within one table -->
<table>
<tbody>
<tr><td colspan="2">Q1</td></tr>
<tr><td>Jan</td><td>$5,000</td></tr>
</tbody>
<tbody>
<tr><td colspan="2">Q2</td></tr>
<tr><td>Apr</td><td>$7,000</td></tr>
</tbody>
</table>3Best Practices
Follow these guidelines when working with <tbody>:
1. Use <tbody> to wrap the actual data rows, separate from header/footer rows
2. Consider multiple <tbody> elements to group related row-sets within one table
3. Style <tbody> rows with CSS (e.g. zebra-striping) using :nth-child for readability
Tip: If you don't explicitly write <thead>/<tbody>/<tfoot>, browsers implicitly wrap your plain <tr> rows in an anonymous <tbody> anyway — writing it explicitly just makes that structure visible and stylable in your markup.
<table>
<thead><tr><th>Month</th><th>Sales</th></tr></thead>
<tbody>
<tr><td>Jan</td><td>$5,000</td></tr>
<tr><td>Feb</td><td>$6,200</td></tr>
</tbody>
</table>