Table Align in HTML

Introduction

 
Copy the following code into any editor you want and save it as .html. This will show table alignment and also changing color on mouseover event:
  1. <table align="left"  border="0"  cellpadding="0" cellspacing="0"  >  
  2.         <tr  
  3.                      <th  align="left" style="height: 17px; width:10%">STATE</th>                      
  4.         </tr>  
  5.                 <tr    >         
  6.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';" >ANDHRA  
  7. PRADESH</td>  
  8.                 </tr>                
  9.                 <tr   >         
  10.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';" >ARUNACHAL  
  11. PRADESH</td>  
  12.                 </tr>  
  13.                 <tr    >  
  14.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">ASSAM</td>  
  15.                 </tr>  
  16.                 <tr   >  
  17.                           <td  style="height: 17px; width:10%"  onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">BIHAR</td>  
  18.                 </tr>  
  19.                 <tr   >  
  20.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'"  
  21. onmouseover="this.bgColor='red';">CHATTISGARH</td>  
  22.                 </tr>  
  23.                 <tr   >  
  24.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">GOA</td>  
  25.                 </tr>  
  26.                 <tr   >  
  27.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">GUJARAT</td>  
  28.                 </tr>  
  29.                 <tr   >  
  30.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">HARYANA</td>  
  31.                 </tr>  
  32.                 <tr   >  
  33.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">HIMACHAL  
  34. PRADESH</td>  
  35.                 </tr>  
  36.                 <tr   >  
  37.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">JAMMU AND  
  38. KASHMIR</td>  
  39.                 </tr>  
  40.                 <tr   >  
  41.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">JHARKHAND</td>  
  42.                 </tr>  
  43.                 <tr  >  
  44.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">KARNATAKA</td>  
  45.                 </tr>  
  46.                 <tr   >  
  47.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">KERALA</td>  
  48.                 </tr>  
  49.                 <tr   >  
  50.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">MADHYA  
  51. PRADESH</td>  
  52.                 </tr>  
  53.                 <tr   >  
  54.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'"  
  55. onmouseover="this.bgColor='red';">MAHARASHTRA</td>  
  56.                 </tr>  
  57.                 <tr   >  
  58.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">MANIPUR</td>  
  59.                 </tr>  
  60.                 <tr   >  
  61.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">MEGHALAYA</td>  
  62.                 </tr>  
  63.                 <tr    >  
  64.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">MIZORAM</td>  
  65.                 </tr>  
  66.                 <tr   >  
  67.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">NAGALAND</td>  
  68.                 </tr>  
  69.                 <tr  >  
  70.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">ORISSA</td>  
  71.                 </tr>  
  72.                 <tr   >  
  73.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">PUNJAB</td>  
  74.                 </tr>  
  75.                 <tr   >  
  76.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">Rajasthan</td>  
  77.                 </tr>  
  78.                 <tr   >  
  79.                           <td  style="height: 17px; width:10%"  onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">SIKKIM</td>  
  80.                 </tr>  
  81.                 <tr   >  
  82.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">TAMILNADU  
  83. </td>  
  84.                 </tr>  
  85.                 <tr   >  
  86.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">TRIPURA</td>  
  87.                 </tr>  
  88.                 <tr   >  
  89.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">UTTAR  
  90. PRADESH</td>  
  91.                 </tr>  
  92.                 <tr   >  
  93.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'"  
  94. onmouseover="this.bgColor='red';">UTTARAKHAND</td>  
  95.                 </tr>  
  96.                 <tr   >  
  97.                           <td  style="height: 17px; width:10%" onmouseout="this.bgColor='#f2f7f0'" onmouseover="this.bgColor='red';">WEST  
  98. BENGAL</td>  
  99.                 </tr>  
  100.    </table>   


Similar Articles