|
Advanced
Home Page
<TABLE> Table
Adding
tables to your homepage can be complicated because several different tags
are used. There is a <TABLE> and </TABLE>
surround the entire which enclose the entire table, and several others tags
to define how information should appear. See below for a complete description
of table tags.
<TABLE> and
</TABLE>
|
This
tag will tell the browser to expect the
other
table tags listed below. Add the word BORDER if you want the grid to appear.
|
<CAPTION> and
</CAPTION>
|
The
text within these tags serves as the table's explanatory caption.
|
<TH> and
</TH>
|
Slightly
enlarges and bolds the text to serve as headers. Identifies the row of
the table.
|
<TR> and
</TR>
|
These
tags define the table's rows
|
< TD>and
< /TD>
|
These
tags surround the text that should go into each cell in the table.
|
|
Adding
all those tags up makes it confusing to create a multi-row table if you
are not careful.
Example
1
<TABLE BORDER=1>
CAPTION>
<CAPTION> Table Caption </CAPTION>
<TR>
|
<!--Started
first row -->
|
<TH>Header 1</TH>
|
< !--
First Column -->
|
<TH>Header 2</TH>
|
< !--
Second Column -->
|
</TR>
|
< !--
End first row -->
|
</TR>
|
<!--Started
second row -->
|
< TD>Data 1 </TD>
|
< !--
First Column -->
|
< TD>Data 2 < /TD>
|
<!--Second Column -->
|
</TR>
|
<!--End second row -->
|
< /TABLE>
|
|
For
documentation purpose, you can enclose your comments in the < !--
and --> tags. The browser will not display anything within these tags.
|
|
The
result will look like this:
|
Table
Caption
Header 1
|
Header 2
|
Data 1
|
Data 2
|
|
TABLE BORDER=1
<TR>
<TD>Row 1 Data 1 </TD>
<TD>Row 1 Data 2 </TD>
</TR>
<TR>
<TD> Row 2 Data 1 </TD>
<TD>Row 2 Data 2 </TD>
</TR>
</TABLE>
|
|
Example
2
The result will look like
this:
|
Row 1 Data 1
|
Row 1 Data 2
|
Row 2 Data 1
|
Row 2 Data 2
|
|
Attributes
BORDER="
"
|
This determines the thickness
of the border of the table
|
WIDTH=" "
|
This specifies the width
for the table.
(In pixels)
|
HEIGHT=" "
|
This specifies the height
for the table.
(In pixels)
|
BGCOLOR= " "
|
This determines the color
of the table
|
|
|
|
|