HTML <th> Tag

If this site has been useful, we’d love your support! Running this site takes time and resources, and every small contribution helps us keep creating valuable content. Consider buying us a coffee to keep things going strong!

Description

The <th> HTML element is designed to create one table cell, which is designated as the header. The text in such a cell is usually displayed in bold by the browser and is aligned in the center. The <th> element must be placed inside the <tr> container, which in turn is located inside the <table>.

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

Attribute Definition
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 table will show you the current browser support for the HTML <th> tag.

Desktop
Edge Chrome Firefox Opera Safari
121112.11
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview
18412.1114.4

Last updated by CSSPortal on: 30th March 2024