Definition
A <thead>
tag is used to define a group of header-related table rows.
Example
<table>
<caption>This is the table's caption</caption>
<thead>
<tr>
<th colspan="2">The table header with one column</th>
</tr>
</thead>
<tbody>
<tr>
<td>The table body</td>
<td>with two columns</td>
</tr>
</tbody>
</table>
Usage
- The opening tag is required.
- The closing tag can be omitted if the
<thead>
is immediately followed by a<tbody>
or a<tfoot>
element. - This
<thead>
can be placed as a child of a<table>
element after any<caption>
and<colgroup>
elements, and before any<tbody>
,<tfoot>
, and<tr>
elements. Only one<thead>
element is permitted in a<table>
element. - The
<thead>
may contain zero or more<tr>
elements.
Attributes
The <thead>
element only supports the Global Attributes.
Specification
Browser Support
Desktop
Chrome | Edge | Firefox | IE | Opera | Safari |
---|---|---|---|---|---|
Yes | Yes | Yes | Yes | Yes | Yes |
Mobile
Android Webview | Chrome Android | Firefox Android | Opera Android | iOS Safari | Samsung Internet |
---|---|---|---|---|---|
Yes | Yes | Yes | Yes | Yes | Yes |