|
|
Tables: An Example
An Example
| | Average |
| Height | Weight |
| Males | 69 | 150 |
| Females | 64 | 130 |
<TABLE BORDER=2>
<CAPTION > An Example </CAPTION>
<TR> <TD ROWSPAN=2> </TD>
<TH COLSPAN=2> Average </TH></TR>
<TR> <TH> Height </TH>
<TH> Weight </TH></TR>
<TR> <TD> Males </TD>
<TD ALIGN=CENTER> 69 </TD>
<TD ALIGN=CENTER> 150 </TD></TR>
<TR> <TD> Females </TD>
<TD ALIGN=CENTER> 64 </TD>
<TD ALIGN=CENTER> 130 </TD></TR>
</TABLE>
- The attribute ALIGN can be used in the CAPTION to place
the caption above (ALIGN=TOP) or below (ALIGN=BOTTOM)
the TABLE.
- Cells may be empty.
- By default, header cells are centered while data cells are flush
left. This can be overriden by the ALIGN attribute for the cell; the
COLSPEC attribute for the TABLE element; or the ALIGN attribute on the
enclosing row's TR element (from the most specific to the least).
- The attribute ALIGN can be used in TD and TH to
specify horizontal placement within the cell
(LEFT, CENTER, RIGHT).
- The attribute ROWSPAN can be used in TD and TH
to specify cells that span more than one row.
- The attribute COLSPAN can be used in TD and TH
to specify cells that span more than one column.
- Cells spanning rows contribute to the column count on each of the
spanned rows, but only appear in the markup once (in the first row
spanned).
- If the column count for the table is greater than the number of cells
for a given row (after including cells for spanned rows), the missing
cells are implied and rendered as empty cells.
- The row count is determined by the TR elements - any rows implied by
cells spanning rows beyond this should be ignored.
By default the table is automatically sized according to
the cell contents and the current window size.
The COLSPEC attribute
can be used when needed to exert control over column widths,
either by
setting explicit widths or by specifying relative widths.
You can also
specify the table width explicitly or as a fraction of the current
margins.
|
|