Register for EarthWeb's Million Dollar Sweepstakes!
home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

HTML 4.0 Sourcebook
(Publisher: John Wiley & Sons, Inc.)
Author(s): Ian S. Graham
ISBN: 0471257249
Publication Date: 04/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


COLGROUP Element: Properties of a Collection of Columns (Internet Explorer Only)

Usage: <COLGROUP> ... (</COLGROUP>)
Can Contain: COL
Can Be Inside: TABLE
Attributes: CLASS, DIR, ID, LANG, STYLE, TITLE, standard event handlers,
ALIGN, BGCOLOR, CHAR, CHAROFF, SPAN, VALIGN, WIDTH

When laying out a table, it is often useful to group columns together, particularly where there is a logical structure associated with a group. For example, the leftmost two columns might be a vertical collection of subject headings, or the two rightmost columns might correspond to spreadsheet totals. Such groupings are possible using COLGROUP, which lets you group columns and assign default alignment or other settings to this group. An example is

<COLGROUP  VALIGN="baseline">
   <COL ALIGN="left">
   <COL ALIGN="center">
</COLGROUP>
<COLGROUP ALIGN="center">
   <COL SPAN="2">
<THEAD> ....

which defines two column groups: the first with baseline vertical alignment, the second with horizontal centering. Note that COLGROUP properties apply to all columns specified within the COLGROUP.

COLGROUP takes the same layout control attributes as COL, and you are referred to the COL element section for a description of these attributes. There are two differences, however. With COLGROUP, SPAN specifies the default number of columns in the group and is ignored if there are any COL elements inside the COLGROUP (it applies only when there are no COL elements inside the group), while the WIDTH attribute defines the width for each column in the group.

The RULES attribute of the TABLE element allows for special rendering of the borders between grouped columns, as illustrated in Figures 6.41 and 6.42.

An example table illustrating COLGROUP is also shown in Figures 6.41 and 6.42. Note that this attribute is currently only supported by Internet Explorer 4.

THEAD Element: Table Header (Internet Explorer Only)

Usage: <THEAD> ... (</THEAD>)
Can Contain: TR
Can Be Inside: TABLE
Attributes: CLASS, DIR, ID, LANG, STYLE, TITLE, standard event handlers,
ALIGN, BGCOLOR, CHAR, CHAROFF, VALIGN

THEAD defines the table header. A table header consists of rows that make up the header of the table (for example, a THEAD might contain one or more rows of TH table header cells). The TABLE element RULES attribute can specify special rendering for the borders between the THEAD and TBODY regions, as illustrated in Figures 6.41 and 6.42. In principle, THEAD could act as a non-scrolling header, such that if a table is longer than the display, the THEAD cells stay at the top of the displayed region as the user scrolls through the table body. There are no browsers that currently implement THEAD and TFOOT in this way.

THEAD takes the same layout control attributes as COL, and you are referred there for a detailed description of these attributes. In the case of THEAD, the layout controls apply to all the cells within the table head.

THEAD must precede the TBODY, which in turn must precede the TFOOT. An example employing THEAD is shown in Figures 6.41 and 6.42. At present, THEAD is only supported by the Internet Explorer browser—it is not supported by Netscape Navigator. Note also that the CHAR and CHAROFF attributes, discussed in the COL section, are not implemented.

TBODY Element: Table Body (Internet Explorer Only)

Usage: (<TBODY>) ... (</TBODY>)
Can Contain: TR
Can Be Inside: TABLE
Attributes: CLASS, DIR, ID, LANG, STYLE, TITLE, standard event handlers,
ALIGN, BGCOLOR, CHAR, CHAROFF, VALIGN

TBODY defines the body of the table. Formally, you do not need to insert TBODY if there are no THEAD or TFOOT elements, since in this case the entire table is the table body, by default. An example employing an explicit TBODY is shown in Figures 6.41 and 6.42.

TBODY takes the same layout control attributes as COL, and you are referred there for a detailed description of these attributes. In the case of TBODY, the layout controls apply to all the cells within the defined table body.

TBODY must follow the THEAD, and must precede the TFOOT. An example employing TBODY is shown in Figures 6.41 and 6.42. At present, TBODY is only supported by the Internet Explorer browser—it is not supported by Netscape Navigator. Note also that the CHAR and CHAROFF attributes, discussed in the COL section, are not implemented.

TFOOT Element: Table Footer (Internet Explorer Only)

Usage: <TFOOT> ... (</TFOOT>)
Can Contain: TR
Can Be Inside: TABLE
Attributes: CLASS, DIR, ID, LANG, STYLE, TITLE, standard event handlers,
ALIGN, BGCOLOR, CHAR, CHAROFF, VALIGN

TFOOT defines the table footer. A table footer consists of table rows that make up the footer of the table. TFOOT content is designed to act like a table banner, so that if the table is longer than the display, then the TFOOT cells stay at the bottom of the displayed portion of the table as the user scrolls through the table body. There are, however, no browsers that support this functionality.

TFOOT takes the same layout control attributes as COL, and you are referred to that section for a detailed description of these attributes. In the case of TFOOT, the layout controls apply to all the cells within the defined table footer.

TFOOT must be the final element in a table, just after TBODY. An example employing TFOOT is shown in Figures 6.41 and 6.42. TFOOT is only supported by Internet Explorer—it is not supported by Netscape Navigator. Note also that the CHAR and CHAROFF attributes, discussed in the COL section, are not implemented.

TR Element: Table Row

Usage: <TR>...(</TR>)
Can Contain: TH, TD
Can Be Inside: TABLE, TBODY, TFOOT, THEAD
Attributes: CLASS, DIR, ID, LANG, STYLE, TITLE, standard event handlers,
ALIGN, BGCOLOR, CHAR, CHAROFF, VALIGN, (BACKGROUND: Netscape Navigator 4 and Internet Explorer 3 only), (BORDERCOLOR, BORDERCOLORDARK, BORDERCOLORLIGHT: Internet Explorer only)


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.