Th tag in HTML5

in this article I am going to describe about the Th tag in HTML5.
  • 1495

Th Tag in HTML5

<th> tag is used for defining the table headers of cells or columns in a table. The <th> tag is used within the <tr> tag and <tr> is nested in <table> tag. This tag must have opening and closing tags. Table header cell means its contain information about header.

An HTML table has two kinds of cells:

  1. Header cells - contains header information (created with the <th> element)
  2. Standard cells - contains data (created with <td> element)

The text in <th> elements are bold and centered by default.

The text in <td> elements are regular and left-aligned by default.

Browser Support

It is supported in all major browsers.


<th>Column header</th>


    Attribute     Value     Description
   colspan    number Specifies the number of columns a header cell should span
   headers    header_id Specifies one or more header cells a cell is related to
   rowspan    number Specifies the number of rows a header cell should span
   scope    col




Specifies whether a header cell is a header for a column, row, or group of columns or rows

Some HTML 4.01 attributes are not supported in HTML5.

Attributes not supported by HTML5 are

  • abbr
  • align
  • axis
  • bgcolor
  • char
  • charoff
  • height
  • nowrap
  • valign
  • width

Example of <th> tag in HTML5

<!DOCTYPE html>


<html lang="en" xmlns="">


    <meta charset="utf-8" />

    <title>Th tag in HTML5</title>

    <table border="1">


            <th>Employee id</th>

            <th>Employee Name</th>















    <p>Table Header Tag in HTML5</p>





© 2020 DotNetHeaven. All rights reserved.