HTML Tables Tutorial

Page 17 - <td> align


To place content in a cell along the horizontal axis you use the attribute align. There are three possible values for this attribute: left, center, and right. Left is the default.


<table border="1" width="300">
   <tr>
      <td>Cell #1</td>
      <td>Cell #2</td>
   </tr>
   <tr>
      <td>Cell #3</td>
      <td>Cell #4</td>
   </tr>
</table>
=
Cell #1 Cell #2
Cell #3 Cell #4

<table border="1" width="300">
   <tr>
      <td>Cell #1</td>
      <td align="center">Cell #2</td>
   </tr>
   <tr>
      <td>Cell #3</td>
      <td align="right">Cell #4</td>
   </tr>
</table>
=
Cell #1 Cell #2
Cell #3 Cell #4
 
 
MPF.com Site Map