**`<thead>`** wraps the row(s) that act as the table's column headers, keeping them semantically distinct from `<tbody>` (the actual data rows) and `<tfoot>` (summary/footer rows). Beyond semantics, browsers use this grouping for print/scroll behavior — for example, when printing a long table across multiple pages, browsers can repeat the `<thead>` content at the top of each printed page automatically.
1Understanding <thead>
`<thead>` wraps the row(s) that act as the table's column headers, keeping them semantically distinct from <tbody> (the actual data rows) and <tfoot> (summary/footer rows). Beyond semantics, browsers use this grouping for print/scroll behavior — for example, when printing a long table across multiple pages, browsers can repeat the <thead> content at the top of each printed page automatically.
A table only needs <thead>/<tbody>/<tfoot> when it's substantial enough to benefit from the grouping — a tiny 2x2 table can just use plain <tr> rows directly inside <table>.
<table>
<thead>
<tr><th>Product</th><th>Price</th></tr>
</thead>
<tbody>
<tr><td>Widget</td><td>$9.99</td></tr>
<tr><td>Gadget</td><td>$19.99</td></tr>
</tbody>
</table>2Practical Example
Here is a real-world application of <thead> showing how it is used in production HTML.
<!-- Long table: thead repeats on each printed page -->
<table>
<thead><tr><th>Date</th><th>Amount</th></tr></thead>
<tbody><!-- 200 rows of transactions --></tbody>
</table>3Best Practices
Follow these guidelines when working with <thead>:
1. Use <thead> to wrap header row(s) in tables with more than a trivial amount of data
2. Keep exactly the column headers in <thead> — actual data belongs in <tbody>
3. Combine with <tbody>/<tfoot> for a fully structured, print-friendly table
Tip: A table only needs <thead>/<tbody>/<tfoot> when it's substantial enough to benefit from the grouping — a tiny 2x2 table can just use plain <tr> rows directly inside <table>.
<table>
<thead>
<tr><th>Product</th><th>Price</th></tr>
</thead>
<tbody>
<tr><td>Widget</td><td>$9.99</td></tr>
<tr><td>Gadget</td><td>$19.99</td></tr>
</tbody>
</table>