References

Beginner-friendly references for web development, with live, editable examples.

The HTML <thead> tag

Element All modern browsers Updated
Quick answer

The HTML <thead> element groups the header rows of a <table>, separating them from the <tbody> data and <tfoot>. It contains one or more <tr> rows of header cells.

Overview

The <thead> element marks the header section of a table — the rows of column labels at the top. It contains <tr> rows made of <th> header cells.

Grouping the headers this way does three useful things: it clarifies the table's structure, it lets you style the header independently of the body, and it allows browsers to repeat the header when a long table is printed across multiple pages — so each page still shows the column labels.

Syntax

<thead>
  <tr><th scope="col">Name</th><th scope="col">Score</th></tr>
</thead>

Example

Live example
<table border="1">
  <thead><tr><th>Name</th><th>Score</th></tr></thead>
  <tbody><tr><td>Ada</td><td>99</td></tr></tbody>
</table>

Best practices

  • Put the column-label rows in <thead>, using <th> cells with scope="col".
  • Use it to style the header row separately from the body.
  • Rely on it so the header repeats on each page when a long table prints.
  • Pair it with <tbody> and, where useful, <tfoot>.

Frequently asked questions

What is the thead element?
It groups the header rows of a table — the rows of column labels — into a distinct section.
Does thead repeat when a table is printed?
Yes. Browsers can repeat the <thead> at the top of each printed page of a long table.
What goes inside thead?
One or more <tr> rows of <th> header cells.
Is thead required?
No, but it is recommended — it clarifies structure, aids styling and enables header repetition on print.