Content · Web Development · HTML

HTML <tbody> Element: Reference and Examples

A clear, practical element reference to tbody. Learn when to use it, see working HTML, and avoid common mistakes.

1 views Published Oct 19, 2026 Updated Oct 19, 2026 Admin

The <tbody> element is used for group body rows in a table. You will run into it while reading other people’s HTML, and it is useful to know what job it does before copying the code.

What does <tbody> mean?


Group body rows in a table. The tag gives the browser a specific kind of content to work with. It is more helpful to choose a tag for its meaning than because of its default look.

Browsers may insert tbody into the DOM even when it is omitted in source.

A working HTML example


Here is a small example you can place in an HTML page and inspect in your browser:

<table>
    <thead><tr><th>Product</th><th>Stock</th></tr></thead>
    <tbody>
        <tr><td>Pencils</td><td>12</td></tr>
        <tr><td>Notebooks</td><td>8</td></tr>
    </tbody>
</table>

Reading the example


Find the <tbody> part first. Notice which elements are around it and how its content or attributes are connected to those other elements.

In this example, <tbody> appears alongside table, tr. That context is often just as important as the element itself.

The browser builds its document from these relationships. Any CSS changes appearance, while interactive JavaScript behavior must be provided separately when the example includes it.

When should you use it?


Use <tbody> when you want to group body rows in a table. A sensible example of this on a real website is the markup shown above; it gives the browser and accessibility tools a clearer job to work with.

Common companions are table, tr. Check the nesting requirements before moving the element into a different location.

Try it yourself


Inspect the DOM and compare tbody nodes with the original HTML source.

Common Beginner Mistakes


  • Keep table rows inside table section elements when writing clear markup.
  • Picking <tbody> only because it looks a certain way instead of checking what it means.
  • Forgetting to inspect the surrounding markup when an element does not behave as expected.

Key Takeaways


  • <tbody> helps group body rows in a table.
  • Browsers may insert tbody into the DOM even when it is omitted in source.
  • Start with meaningful markup, then add styling or scripting only when the page needs it.
Share this resourceSend this page to someone who may find it useful.