HTML
|
JavaScript
Alignment
Basics
Character Codes
Colors
CSS
DIVS
Forms
Frames
Links
Lists and Bullets
Meta Tags
Multimedia
Pictures
Spacing
Tables
Text
Background Picture
Basic Table
Cell Padding
Cell Spacing
Colspan Rowspan
Table Alignment
Table Border
Table Colors
Table Shadow
Width and Height
Width and Height
271
Table Width and Height
Description
Table 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
<TABLE WIDTH="200" HEIGHT="70" border="1"> <TR> <TD> Oatmeal and peanut butter tastes wonderful. </TD> </TR> </TABLE>
Cell Width and Height
Description
Cell 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
<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>
Advertisements