thead – table head
<thead><tr><th>…</th></tr></thead>
A group of rows with the column headers. It comes after caption and colgroup, before the body of the table. When a long table is printed, browsers repeat it at the top of every page.
- Default display:
display: table-header-group - End tag: can be omitted when
tbodyortfootfollows immediately - Content: rows
tr - Where it can be used:
table– aftercaptionandcolgroup, beforetbodyandtfoot; only one per table - DOM interface:
HTMLTableSectionElement
Attributes
Only global attributes (the obsolete align, valign are replaced by CSS).
Examples
A header that stays at the top when a long table is scrolled:
<div class="wrapper">
<table>
<thead>
<tr><th>Day</th><th>Sales</th></tr>
</thead>
<tbody>
<tr><td>Monday</td><td>310</td></tr>
<tr><td>Tuesday</td><td>290</td></tr>
<tr><td>Wednesday</td><td>305</td></tr>
<tr><td>Thursday</td><td>330</td></tr>
</tbody>
</table>
</div>
.wrapper {
height: 90px;
overflow-y: auto;
}
.wrapper thead th {
position: sticky;
top: 0;
background: #fff;
}
Things to watch out for
- Sticking the header is set on the
thcells (or onthead), not ontr, and needs an opaque background. - Headers do not have to be in
theadfor screen readers to recognize them –this enough.theadhelps styles, printing and scripts.
Browser support
Baseline – widely available: works in all major browsers and has for a long time (since 2015 at the latest). Since version: Chrome 1, Firefox 1, Safari 1. As of October 2026 (MDN browser-compat-data).
Related:
table – table
tbody – table body
tfoot – table foot
th – header cell
tr – table row