building table html code example

Example 1: html create a table

<html>
 <head>
   <title>Working with HTML Tables</title>
 </head>
 <body>
   <table>				<!-- create an table object -->
     <tr>				<!-- "tr" represents a row -->
       <th>Name</th>	<!-- use "th" to indicate header row -->
       <th>Date of Birth</th>
       <th>Weight</th>
     </tr> 
     <tr>				<!-- once again use tr for another row -->
       <td>Mary</td>	<!-- use "td" henceforth for normal rows -->
       <td>12/13/1994</td>
       <td>130</td>
     </tr>    
   </table>
 </body>
</html>

Example 2: how to create a table html

<table>
  <tr>
    <td>First cell of the first row</td>
    <td>Second cell of first row</td>
  </tr>
  <tr>
    <td>First cell of second row</td>
    <td>Second cell of second row</td>
  </tr>
</table>

Tags:

Html Example