HTML Tags

HTML <th> Tag

The <th> tag in HTML defines a header cell in a table.
Header cells are typically displayed in bold text and centered by default. They help describe the content of each column or row, making data tables easier to understand and accessible.

Syntax

<th scope="col|row">Header Content</th>

Attributes

AttributeDescription
abbrProvides an abbreviated version of the header cell content for screen readers.
colspanSpecifies the number of columns a header cell should span.
rowspanSpecifies the number of rows a header cell should span.
headersAssociates the header cell with one or more data cells (id values of <td> elements).
scopeDefines whether the header applies to a row, column, row group, or column group (row, col, rowgroup, colgroup).

💡 Tip: Use the scope attribute to improve accessibility, especially for assistive technologies.

Example

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>HTML th Tag Example</title>
</head>
<body>
  <h2>Example of the &lt;th&gt; Tag</h2>
  <table border="1">
    <tr>
      <th scope="col">Month</th>
      <th scope="col">Savings</th>
    </tr>
    <tr>
      <td>January</td>
      <td>$100</td>
    </tr>
    <tr>
      <td>February</td>
      <td>$150</td>
    </tr>
  </table>
</body>
</html>

Output

Browser Output

There is visible output for this tag — it displays the table header cells in bold and center-aligned text by default.
Use our TryIt Editor to test and modify the example live.

Browser Support

Chrome
Chrome
Firefox
Firefox
Edge
Edge
Safari
Safari
Opera
Opera
IE
IE9+
✅Yes✅Yes✅Yes✅Yes✅Yes✅Yes

Notes

  • <th> is always contained inside <tr>.
  • Can be used with <thead>, <tbody>, or <tfoot> to structure table headers.
  • scope, colspan, and rowspan attributes improve accessibility and semantic clarity.
  • Browser styling: Bold and center-aligned by default, but fully customizable via CSS.

Conclusion

  • The <th> tag defines header cells in a table, giving structure to columns or rows.
  • It enhances readability and accessibility, especially for screen readers.
  • Using <th> properly ensures your tables are semantic, clear, and easy to interpret.

Sign In Form

User your email and password to singn in

Don’t have an account, signup here : 

HTML5 & CSS3

Tools and Tutorials

Want a Website

Want a website for your business ?

Please fill out the details below, so we can reach out to you.

Registration Form

Signup to track your record and much more.

We have sent you an email with a registration link. Please click the link to verify your email address, or enter the 6-digit OTP provided in the email.

Didn't receive the OTP. Regenerate OTP Resend