Width and Height
Table Width and Height
DescriptionTable width and height specifies the width and height for the entire table. To specify the width and height, you will need to add the lines WIDTH="X" and HEIGHT="X" to the <TABLE> tag so the final result looks like:

<TABLE WIDTH="X" HEIGHT="X">

The X in the lines, are replaced with the number of pixels or percentage of page that you want either the width or height to be for the table.
Code
<TABLE WIDTH="200" HEIGHT="70" border="1">

<TR> <TD>
Oatmeal and peanut butter tastes wonderful.
</TD> </TR>

</TABLE>
Output
Oatmeal and peanut butter tastes wonderful.
Practice
Cell Width and Height
DescriptionCell width and height specifies the width and height for a single cell. To specify the width and height, you add the lines WIDTH="X" and HEIGHT="X" to the <TD> tag of the cell you want so the final result looks like:

<TD WIDTH="X" HEIGHT="X">

The X in the lines, are replaced with the number of pixels or percentage of page that you want either the width or height to be for the cell. Please note that cells in the same row cannot differ in height.
Code
<TABLE border="1"> <TR>

<TD WIDTH="100" HEIGHT="70">
Hi! I'm on the left side.
</TD>

<TD WIDTH="50" HEIGHT="70">
And I'm over on the right.
</TD>

</TR> </TABLE>
Output
Hi! I'm on the left side. And I'm over on the right.
Practice
Advertisements