CSS Portal

HTML <th> Tag

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The <th> (table header) element in HTML is used to define a header cell in a table. Header cells are typically displayed as bold and centered by default, helping to distinguish them from regular table data cells (<td>). They provide semantic meaning to the table, indicating that the content of the cell serves as a header for a row, column, or group of rows/columns.

A <th> element can be placed inside a <tr> (table row) within the <thead>, <tbody>, or <tfoot> sections of a table. Its primary purpose is to improve both readability and accessibility, as header cells are used by screen readers and other assistive technologies to provide context for table data.

Visually, most browsers render <th> text in bold and center-aligned by default, although this can be customized using CSS. Semantically, <th> cells can describe the content of the column or row they head, making complex tables easier to understand and navigate.

Additionally, <th> can be used in combination with the scope attribute to explicitly define whether it is a header for a row, column, or group of rows/columns, further enhancing clarity for assistive technologies.

Properties

Permitted Parents
A <tr> element
Content
Block, inline and text
Start/End Tags
Start tag: optional, End tag: optional

Example

<table border="1">
<tr>
<th>Animal</th>
<th>Color</th>
</tr>
<tr>
<td>Mouse</td>
<td>White</td>
</tr>
</table>

Attributes

scope
Defines a way to associate header cells and data cells in a table.
abbr
Specifies an abbreviated version of the content in a cell.
rowspan
Sets the number of rows a cell should span.
colspan
Specifies the number of columns a cell should span.

Global Attributes

The <th> tag also supports the Global Attributes in HTML5

Event Attributes

The <th> tag also supports the Event Attributes in HTML5

Browser Support

The following information will show you the current browser support for the HTML <th> tag. Hover over a browser icon to see the version that first introduced support for this HTML tag.

This tag is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 26th December 2025

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!