HTML <thead> Element
The <thead> element groups one or more header rows in an HTML table. It helps distinguish rows containing column headings or other introductory information from the main table data and optional footer rows.
Syntax
<table>
<thead>
<tr>
<th>Product</th>
<th>Price</th>
</tr>
</thead>
<tbody>
<tr>
<td>Notebook</td>
<td>$4.95</td>
</tr>
</tbody>
</table>
Attributes
The <thead> element supports the global HTML attributes. It does not have any element-specific attributes.
Example
This example uses <thead> to group the table's column headings separately from the data rows contained in <tbody>.
Usage Notes
The <thead> element is placed inside a <table> element and contains one or more <tr> elements. It is normally used to group rows containing headings that describe the columns of the table.
A table can contain only one <thead> element. When present, it appears before any <tbody> and <tfoot> elements.
Using <thead>, <tbody>, and <tfoot> separates a table into meaningful structural sections and can make larger tables easier to understand, style, and maintain.
Accessibility
The <thead> element provides structural grouping for header rows, but the individual header cells should still use <th> elements. Where appropriate, the scope attribute can identify whether a header applies to a row, column, row group, or column group, helping assistive technologies understand relationships within the table.
Browser Support
Baseline: Widely available indicates a feature has been supported by core browsers for at least 30 months. At this stage, the feature is considered stable and safe for most websites to use without needing to worry about compatibility issues or fallbacks, as it is supported by the vast majority of users' devices and browser versions.
For detailed browser compatibility information, see Can I Use: HTML <thead> Element .
Related Elements
The <thead> element is used with other table elements, including <table>, <tbody>, <tfoot>, <tr>, <th>, and <td>.
Specifications
The <thead> element is defined in the WHATWG HTML Living Standard .
