TABLE Data Display 7

Displaying your data in your table

Row 1 duck Cell 3 duck Cell 5
Row 2 duck Cell 4
Row 3
spacer 2

TABLE Data Display - Table Height and Width

The "height" and "width" attributes can both be used in the <table>, <th> and <td> elements. Only the "height" attribute can be used in the<tr> element.  If you noticed, I have been using the "width" attribute in a number of the previous examples. You have probably used these attributes many times, so I won't go into great detail other than the examples.

Example 1 Using "height" and "width" in the Table

<tr>
  <td align="center">
    <table height="300" width="500" bgcolor="#FFFF00" border="7" style="border-color:#900" cellpadding="5">
      <tr class="trtext1">
        <th width="60%" bgcolor="#99FF99">File Name</th>
        <th width="40%">Submitter</th>
      </tr>
      <tr bgcolor="#FFFF99">
        <td>File for research purposes</td>
        <td bgcolor="#FF6699">Bryant Walker</td>
      </tr>
    </table>
  </td>
</tr>
File Name Submitter
File for research purposes Bryant Walker

The example shows everything in the table as before except the table has expanded when I added a "height" attribute to the table.   Notice that the cells are expanded in proportion to the height of the table.  If you add additional rows, the cells will adjust to be equal in height within the height of the table.

Example 2 Using Height in the Cells

<tr>
  <td width="300" align="center">
    <table border="7" style="border-color:#900" cellpadding="5">
      <tr class="trtext1">
        <td width="60%">File Name</td>
        <td width="40%">Submitter</td>
      </tr>
      <tr class="tdheader">
        <td height="80">File for research purposes</td>
        <td>Bryant Walker</td>
      </tr>
    </table>
  </td>
</tr>
File Name Submitter
File for research purposes Bryant Walker

I added height to the second row by adding the "height" attribute to the first cell. The second cell follows the height in the first cell and the table expands accordingly, even thought it does not contain the "height" attribute.

CLICK FOR PAGE 8 on Table Titles


Previous Page Next Page