Open In App
Related Articles

How to group header content of a table using HTML5 ?

Improve Article
Save Article
Like Article

In this article, we define to group the header content in a table by using the <th> tag in HTML to set the header cell of a table. Two types of cells in an HTML table.

  • Header Cell: It is used to hold the header information.
  • Standard Cell: It is used to hold the body of data.

The working of both tags (<th> and <td>) are same but the text properties are different. In <th> tag, text is bold and centered, and in <td> tag, text is regular and left align by default.


<th> Contents... </th>


<!DOCTYPE html>
        Group the header content 
        in a table using HTML
        body {
            text-align: center;
        h1 {
            color: green;
        th {
            color: blue;
        td {
            border: 1px solid black;
            border-collapse: collapse;
            HTML5: How to group the 
            header content in a table?
                    <th>User Id</th>


Supported Browsers are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

Last Updated : 05 Jun, 2020
Like Article
Save Article
Similar Reads
Related Tutorials