|
Tables
Using TABLES in your page layout has several key advantages:
|
·
|
Tables are an excellent format for displaying
certain types of data
|
|
·
|
Tables provide more control in the placement
of text and images.
|
|
·
|
Tables enable page layout to display more
consistently and uniformly on different browsers
|
Basically, TABLES are all about control.
Boxes Inside
of Boxes
It is probably easier to think of a TABLE as a flat, two dimensional
box. Inside of this box, you can place other boxes, or CELLS, and inside
of these boxes, you put text, images, or even more boxes. This is a
very simple table that contains four cells:
|
CELL 1
|
CELL 2
|
|
CELL 3
|
CELL 4
|
The
TABLE CELL, or <TD> is the
basic unit of a cell. You can have as many or as few cells in your
table as you wish. A horizontal row of cells is called a TABLE ROW
or <TR>. CELLS go into ROWS.
In the example above, Cell 1 and Cell
2 form one table row, and cells 3 and 4 form another table row. Always remember that cells go into rows, and rows
go into a table.
Here is what the HTML for a table looks
like:
<TABLE>
<TR>
<TD>Your
Data </TD>
</TR>
</TABLE>
Notice
how the opening and closing <TD> tags
are nested inside of the <TR> tags, and likewise, the <TR> tags
are nested inside the <TABLE> tags.
Here's the HTML for a more complicated
table:
<TABLE>
<TR>
<TD> Your
Data </TD>
<TD> Your
Data </TD>
</TR>
<TR>
<TD> Your
Data </TD>
<TD> Your
Data </TD>
</TR>
</TABLE>
This example depicts a table with two
Table Rows - each row containing two Cells - resulting in a four
cell table.
More Attributes
You can position your text or image inside of the table cell itself
by using the <ALIGN> and <VALIGN> attributes inside
the <TD> tag.
ALIGN
|
VALIGN
|
|
align=left
|
valign=top
|
|
align=center
|
valign=middle
|
|
align=right
|
valign=bottom
|
NOTE: Use only one <ALIGN> and one <VALIGN> attribute
per table cell.
Using your attributes
like this would place your text in the upper left hand corner of
your cell:
<TD ALIGN=left VALIGN=top>
|