Understanding HTML tables Part 4
|
Table Attributes
continued...Width
height can be set in pixels or percentage.- if the table is set to a percentage, it will be a percentage of the page ie will be 30% of the width of the page.
- if the data cell is set to a percentage, it will be a percentage of the table. If no table width has been set, then the table will end up twice the width of the contents of the data cell.
setting the width of the table to 400 px
setting the width of the table to 400 px
setting the width of the table to 400 px and the data cell to 200 px.
setting the width of the table to 400 px and the data cell to 200 px. Note that the data doesn't span across the whole width of the table. Height
height can be set in pixels or percentage.- if the table is set to a percentage, it will be a percentage of the page ie will be 30% of the height of the page.
- if the data cell is set to a percentage, it will be a percentage of the table. If no table height has been set, then the table will end up twice the height of the contents of the data cell.
setting the height of the table to 200 px
setting the height of the
table to 200 px
setting the height of the data cell to 200 px forces the size of the table to 200 px if it's not set.
setting the height of the
data cell to 200 px forces the size of the table to 200 px if it's not set.
Alignment
align= valign= - left
- center
- right
- top
- middle
- bottom