Tables in HTML


HTML Tables

Tables are defined with the <table> tag.

Tables are divided into table rows with the <tr> tag.

Table rows are divided into table data with the <td> tag.

A table row can also be divided into table headings with the <th> tag.

A table can be labeled with <caption> tag.

Sample 01

<table border="1" style="width:100%">

         <caption>Trainer's Details</caption>

<tr>
                   <td>First Name</td>
                   <td>Last Name</td>
                   <td>Age</td>
          </tr>

           <tr>
                   <td>Saleema</td>
                   <td>Parvin</td>
                   <td>36</td>
          </tr>
          <tr>
                   <td>Syed</td>
                   <td>Nawas Ahamed</td>
                   <td>32</td>
          </tr>
</table>

Check Output


Note: The border attribute is on its way out of the HTML standard! It is better to use CSS for formatting. we will look out CSS in following blogs.

No comments:

Post a Comment