HTML Tables Tutorial

Page 13 - <table> align


By putting the align attribute in a table tag you can "float" the table in text to allow the text to wrap around the table. Netscape does not do as good of a job with this.


<table border="1">
   <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
There is no <br> or <p> tag before this text, the end of the table forces it to be on a new line.

<table border="1" align="left">
   <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
There is no <br> or <p> tag before this text, but the align attribute allows the text to wrap around the table. You can also use the attributes hspace and vspace to put padding around the table.
 
 
MPF.com Site Map