HTML Tables Tutorial

Page 12 - <table> height


Like with the width, by default a table is only as tall as it needs to be. That is to say the content of the table determines its height. You can see that the first table is only as tall as its content. The second table is two hundred pixels high, as the height attribute in the table tag specifies. As a rule of thumb you do not specify the height of a table, rather you let the content determine the height.
<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

<table border="1" height="200">
   <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
 
 
MPF.com Site Map