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 tbody or tfoot follows immediately
  • Content: rows tr
  • Where it can be used: table – after caption and colgroup, before tbody and tfoot; 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;
}
result
DaySales
Monday310
Tuesday290
Wednesday305
Thursday330

Things to watch out for

  • Sticking the header is set on the th cells (or on thead), not on tr, and needs an opaque background.
  • Headers do not have to be in thead for screen readers to recognize them – th is enough. thead helps 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