HTML - tags - <thead>

#136 of 147
thead
Next time
Prev th

 <html>
 <body>
     <table>
         <caption>Population by Country</caption>
         <colgroup>
             <col>
             <col span="2" style="background-color:lightgreen">
             <col>
         </colgroup>
         <thead>
             <tr>
                 <th>Country</th>
                 <th>Population</th>
             </tr>
         </thead>
         <tfoot>
             <tr>
                 <td>Total</td>
                 <td>3 billion</td>
             </tr>
         </tfoot>
         <tbody>
             <tr>
                 <td>China</td>
                 <td>1.4 billion</td>
             </tr>
         </tbody>
     </table>
 </body>
 </html>
 

The thead element contains header information -- i.e. column names -- for the table element.

A live example:


Population by country
Country Pop Pop 2030 % change
Total 3 billion 3.3 billion 10%
China 1.38 billion 1.41 billion 2.1%
India 1.31 billion 1.53 billion 16.8%
USA 322 million 356 million 10.6%

N of

Ads by Google

Ask a question, send a comment, or report a problem - click here to contact me.

© Richard McGrath