Skip to content
Related Articles

Related Articles

How to create a header cell in a table using HTML5 ?

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 15 Oct, 2020

In this article, we will create a header cell in a table. The approach of this article is to create a Header cell in an HTML table. It is used to set the header cell of a table. The Header cell is used to hold the header information.


<th> Contents... </th>


<!DOCTYPE html>
      body {
         text-align: center;
      h1 {
         color: green;
      th {
         color: blue;
      td {
         border: 1px solid black;
         border-collapse: collapse;
         margin: 0 auto;
   <h2>How to create a header cell
      in a table using HTML5 ?</h2>
            <!-- th M starts here -->
            <th> MEDICINES</th>
            <th>Batch No.</th>
            <!-- th tag end here -->


Supported Browsers:

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

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!