Loading Please Wait...

Logo Lynxsia IT Solutions

HTML Table Headers

Table Headers

HTML tables can have horizontal & vertical headers. <th> tag is used to define table headers.

Horizontal Table Header
					 
        
          <!DOCTYPE html>
          <html>
            <head>
             <style>
               table, th, td{
                 border: 1px solid #000000;
                 border-collapse: collapse;
               }
             </style>
            </head>
            <body>
              <table>
                <tr>
                  <th>Name</th>
                  <th>Email</th>
                </tr>
                <tr>
                  <td>John</td>
                  <td>john@gmail.com</td>
                </tr>
                <tr>
                  <td>Micheal</td>
                  <td>micheal@gmail.com</td>
                </tr>
              </table>
            </body>
          </html>
        
      
Vertical Table Header
					 
        
          <!DOCTYPE html>
          <html>
            <head>
             <style>
               table, th, td{
                 border: 1px solid #000000;
                 border-collapse: collapse;
               }
             </style>
            </head>
            <body>
              <table>
                <tr>
                  <th>Name</th>
                  <td>John</td>
                  <td>Micheal</td>
                </tr>
                <tr>
                  <th>Email</th>
                  <td>john@gmail.com</td>
                  <td>micheal@gmail.com</td>
                </tr>
              </table>
            </body>
          </html>
        
      
Mixed Table Header
					 
        
          <!DOCTYPE html>
          <html>
            <head>
             <style>
               table, th, td{
                 border: 1px solid #000000;
                 border-collapse: collapse;
               }
             </style>
            </head>
            <body>
              <table>
                <tr>
                  <th> </th>
                  <th>Mon</th>
                  <th>Tue</th>
                </tr>
                <tr>
                  <th>8:00</th>
                  <td>Eng</td>
                  <td>Math</td>
                </tr>
                <tr>
                  <th>9:00</th>
                  <td>Sci</td>
                  <td>Hindi</td>
                </tr>
              </table>
            </body>
          </html>
        
      
Header With <thead> And <tfoot> Tag
					 
        
          <!DOCTYPE html>
          <html>
            <head>
              <style>
                table, th, td{border: 1px solid #000000}
              </style>
            </head>
            <body>
              <table>
                <thead>
                  <tr>
                    <th>Name</th>
                    <th>Email</th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td>John</td>
                    <td>john@gmail.com</td>
                  </tr>
                </tbody>
                <tfoot>
                  <tr>
                    <th>Name</th>
                    <th>Email</th>
                  </tr>
                </tfoot>
              </table>
            </body>
          </html>
        
      

How you feel about this blog:

Share this blog on:

Report Us

If you find any error in the turtorials, or want to share your suggestion/feedback, feel free to send us email at: info@lynxsia.com

Contact Us
Ads
Logo
Lynxsia IT Solutions

We are concern with various development process like website design & development, E-commerce development, Software development, Application development, SMS & Bulk SMS Provider, PWA Development, and many more..

Kotwali Road, Chhiptehri, Banda, 210001, UP, India

Copyright © 2022, Lynxsia IT Solutions, All rights reserved