![]() Capt. Horatio T.P. Webb |
HTML TABLE EXAMPLES Spring 2010 |
Here are the three "align" examples:
this is a table with one cell and a TABLE attribute of:
align="left" attribute |
this is a table with one cell and a TABLE attribute of:
align="center" attribute |
this is a table with one cell and a TABLE attribute of:
align="right" attribute |
this is a table with one cell and a TABLE attribute of:
width="100" attribute |
this is a table with one cell and a TABLE attribute of:
width="200" attribute |
this is a table with one cell and a TABLE attribute of:
width="50%" attribute |
this is a table with one cell and a TABLE attribute of:
width="100%" attribute |
Note that BOTH the % examples calculate the % based on the width of the open window (in this case it IGNORS the fact that the table is inside a list that has indents.
and a TABLE attribute of:
bgcolor="rgb(204,0,0)" attribute
and a TABLE attribute of:
bgcolor="LavenderBlush" attribute
and two TABLE attributes:
bgcolor="rgb(204,0,0)" attribute
and two TABLE attributes:
bgcolor="rgb(204,0,0)" attribute
and two TABLE attributes:
bgcolor="rgb(204,0,0)" attribute
Then of course there is the case:
In the following examples all table cells have their widths set to 200.
this is a table with one cell
this is a table with one cell
this is a table with one cell
and
border="0"
this is a table with one cell
and
border="1"
this is a table with one cell
and
border="4"
this is a table with two rows with cells
and a TABLE attributes:
cellspacing="0"Note that the cells have
no space between them
verticallyhere is some extra text
to demonstratehere is some extra text
to demonstratethis is a table with two cells
and a TABLE attributes:
cellpadding="0"Note that the cells have
no space between them
verticallyhere is some extra text
to demonstratehere is some extra text
to demonstratethis is a table with two rows with cells
and a TABLE attributes:
cellspacing="10"Note that the cells have
no space between them
verticallyhere is some extra text
to demonstratehere is some extra text
to demonstratethis is a table with two cells
and a TABLE attributes:
cellpadding="10"Note that the cells have
no space between them
verticallyhere is some extra text
to demonstratehere is some extra text
to demonstratethis is a table with two rows with cells
and two TABLE attributes:
cellspacing="0"
and
cellpadding="0"Note that the cells have
no space between them
verticallyhere is some extra text
to demonstratehere is some extra text
to demonstratethis is a table with two rows with cells
and two TABLE attributes:
cellspacing="10"
and
cellpadding="10"Note that the cells have
no space between them
verticallyhere is some extra text
to demonstratehere is some extra text
to demonstrate
Start tag: required, End tag: optional
cell A cell B cell C cell A
this row has a <TR> tag with:
bgcolor="rgb(127,127,127)"cell B cell C cell A cell B cell C
Start tag: required, End tag: optional
cell row 1 col 1
cell row 1 col 2
cell row 1 col 3
cell row 1 col 4
cell row 2 col 1
cell row 2 col 2
AND
row 3 col col2
this cell has:
rowspan="2"cell row 2 col 3
cell row 2 col 4
cell row 3 col 1
cell row 3 col 3
cell row 3 col 4
cell row 1 col 1
cell row 1 col 2
cell row 1 col 3
cell row 1 col 4
cell row 2 col 1
cell row 2 col 2
AND
row 2 col col 3
this cell has:
colspan="2"cell row 2 col 4
cell row 3 col 1
cell row 3 col 2
cell row 3 col 3
cell row 3 col 4
cell row 1 col 1
cell row 1 col 2
cell row 1 col 3
cell row 1 col 4
cell row 2 col 1
cell row 2 col 2
&
row 2 col col 3
cell row 3 col 2
&
row 3 col col 3
this cell has:
colspan="2"
AND
rowspan="2"cell row 2 col 4
cell row 3 col 1
cell row 3 col 4
cell row 4 col 1
cell row 4 col 2
cell row 4 col 3
cell row 4 col 4
this cell has width="100"
this cell has width="200"
this cell has width="300"
this cell has height="50" this cell has height="100" this cell has height="150"
Cell A
the <TD> tag for this cell:
has an attribute:
align="left"Cell B
the <TD> tag for this cell:
has an attribute:
align="center"Cell C
the <TD> tag for this cell:
has an attribute:
align="right"
Cell A
the <TD> tag for this cell:
has an attribute:
valign="top"
This Cell has more
data than
the ones to the right
creating some extra heightCell B
the <TD> tag for this cell:
has an attribute:
valign="middle"Cell C
the <TD> tag for this cell:
has an attribute:
valign="bottom"