HTML Tables Tutorial

Page 22 - <tr> align


If you want every cell in a row to be aligned to the center then you can specify this in the <tr> tag. Reduces some typing by not having to do so in every <td> tag. You can override the row alignment of a cell by placing the align attribute in the <td>.


<table border="1" width="300" >
   <tr align="center">
      <td>Cell #1</td>
      <td>Cell #2</td>
      <td>Cell #3</td>
   </tr>
   <tr align="center">
      <td>Cell #4</td>
      <td>Cell #5</td>
      <td align="right">Cell #6</td>
   </tr>
</table>
=
Cell #1 Cell #2 Cell #3
Cell #3 Cell #4 Cell #6

 
 
MPF.com Site Map