HTML Tables


Go to main Page

Tables in HTML

Example


<table border="1"  >

<tr>
<th>Name</th>
<th>Class</th>
<th>Section</th>


</tr>
<tr>
 
    <td>Shameer</td>
    <td>One</td>
    <td>A</td>
    
</tr>
<tr>
        <td>Faisal</td>
        <td>Two</td>
        <td>B</td>
        
        
</tr>
<tr>
            <td>Saqlain</td>
            <td>Three</td>
            <td>C</td>
            
            
</tr>
 <tr>
                <td>Zeeshan</td>
                <td>Four</td>
                <td>D</td>
                
                
</tr>
</table>


  

Cell Spacing and Cell Padding in Tables

we can add cell spacing and cell padding in the table by using cell spacing and cell padding attributes in table tag.


<table align="center" border="1" cellspacing="0" cellpadding="10px" >

    <tr>
    <th>Name</th>
    <th>Class</th>
    <th>Section</th>
    
    
    </tr>
    <tr>
     
        <td>Shameer</td>
        <td>One</td>
        <td>A</td>
        
        </tr>
    
        <tr>
            <td>Faisal</td>
            <td>Two</td>
            <td>B</td>
            
            
            </tr>
    
             <tr>
                <td>Saqlain</td>
                <td>Three</td>
                <td>C</td>
                
                
                </tr>
  <tr>
                    <td>Zeeshan</td>
                    <td>Four</td>
                    <td>D</td>
                    
                    
                    </tr>
    </table>