Skip to the page
html reference · layout

HTML <thead> / <tbody> tags

closing tag
required (both)
void element
no
lives inside
<table>
typically holds
<tr> rows

Where it goes

Directly inside <table>: <thead> with the header row, then <tbody> with everything else.

Example

<table>
  <thead>
    <tr><th scope="col">Name</th><th scope="col">Age</th></tr>
  </thead>
  <tbody>
    <tr><td>Ann</td><td>30</td></tr>
  </tbody>
</table>

Open this example in the editor →

Common mistakes

  • Putting rows directly in <table> next to a <tbody>. The browser wraps the loose rows in a second, invisible <tbody>.
  • Using <thead> for the table's title. The header is for column names. A title goes in <caption>, right after the opening <table> tag.
  • Fighting CSS to make the header row look different. <thead> gives you a selector for exactly that.

Related

Updated 24 October 2026. Practice it in the html route, or read more on MDN.