HTML <TH> Tag

The <th> tag in html is similar as <td> tag, the only difference is <td> tag is used to create a table cell on the other hand <th> is used to define table header. The data between <th></th> tags is bold and centered by default.

Below is the html code example to show the usage of <th> tag in table.

   1:  <html>
   2:  <head>
   3:  <title>
   4:  COLS attribute
   5:  </title>
   6:  </head>
   7:  <body>
   8:  <table border="1" width="100%">
   9:  <tr>
  10:  <th>
  11:  Month
  12:  </th>
  13:  <th>
  14:  Year
  15:  </th>
  16:  </tr>
  17:  <tr>
  18:  <td>
  19:  March
  20:  </td>
  21:  <td>
  22:  2011
  23:  </td>
  24:  </tr>
  25:  </table>
  26:  </body>
  27:  </html>
 
image

Tags: , , , , , ,

Author: Revo

Share This Post On

Submit a Comment

Your email address will not be published. Required fields are marked *

nineteen − 17 =

 

Pin It on Pinterest

Shares
Share This