The <THEAD>, <TBODY> and <TFOOT> tags are always used in conjunction. These tags define proper structure of table same like in Microsoft word we can divide the document in header, body and footer same can be done in HTML using THEAD>, <TBODY> and <TFOOT> tags. The major objective to divide the table into three section is to handle the scrolling of large tables in browsers. After applying these tags on table the header and footer part will be non-scrollable which makes it easy for the user to read and understand the table.


<THEAD></THEAD> must appear before <TBODY> tag , Rows between these tags are part of table header and non-scrollable.

<TBODY</TBODY> comes after <THEAD></THEAD> tag, Rows between these tags are part of table body.

<TFOOT></TFOOT>  must defined  before <TBODY> and after <THEAD></THEAD> tags, Rows between these tags are part of table footer.

The following examples specify the header,body and footer rows in the table.


   1:  <html>
   2:  <head>
   3:  <title>
   4:  THEAD, TBODY and TFOOT Tags
   5:  </title>
   6:  </head>
   7:  <body>
   8:  <table width="80%" border="1">
   9:  <thead>
  10:  <th>Date</th>
  11:  <th>Day</th>
  12:  </thead>
  13:  <tbody>
  14:  <tr>
  15:  <td>1st March 2011</td>
  16:  <td>Sunday</td>
  17:  </tr>
  18:  <tr>
  19:  <td>2nd March 2011</td>
  20:  <td>Monday</td>
  21:  </tr>
  22:  </tbody>
  23:  <tfoot>
  24:  <tr>
  25:  <td> Date </td>
  26:  <td> Day </td>
  27:  </tfoot>
  28:  </body>


Tags: , , , , , , , ,

Author: Revo

Share This Post On

Submit a Comment

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

5 − 2 =


Pin It on Pinterest

Share This