Click Here!
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.

Platinum Edition Using HTML 4, XML, and Java 1.2
(Publisher: Macmillan Computer Publishing)
Author(s): Eric Ladd
ISBN: 078971759x
Publication Date: 11/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


<TBODY>

Type:

Container

Function:

Defines the body section of the table.

Syntax:

<TBODY ALIGN=”LEFT|CENTER|RIGHT|JUSTIFY|CHAR”
 VALIGN=”TOP|MIDDLE|BOTTOM|BASELINE” CHAR=”alignment_character”
 CHAROFF=”alignment_character_offset”>
...
</TBODY>

Attributes:

<TBODY> can take the following attributes:

  ALIGN—Controls the horizontal alignment within the cells of the table body. ALIGN can take on values of LEFT, RIGHT, CENTER, JUSTIFY, and CHAR.
  CHAR—Specifies the alignment character for when ALIGN=”CHAR” is used.
  CHAROFF—Prescribes the offset distance from the alignment character.
  VALIGN—Controls the vertical alignment in the body cells. VALIGN can take on values of TOP, MIDDLE, BOTTOM, or BASELINE.

Example:

<TBODY ALIGN=”LEFT” VALIGN=”BASELINE”>
<TR>
<TD>Red Storm Rising</TD>
<TD>1500 pages (paperback)</TD>
<TD>$9.95</TD>
...
</TR>
</TBODY>

Related Tags:

You specify the rows and cells in the table body by using the <TR>, <TH>, and <TD> tags. A table body section must contain at least one row.

<COLGROUP>

Type:

Container

Function:

Groups a set of columns so that properties may be assigned to all columns in the group rather than to each one individually.

Syntax:

<COLGROUP SPAN=”number_of_columns” WIDTH=”width_of_column_group”
  ALIGN=”LEFT|RIGHT|CENTER|JUSTIFY|CHAR”
 VALIGN=”TOP|MIDDLE|BOTTOM|BASELINE”
 CHAR=”alignment_character” CHAROFF=”alignment character_offset”>
...
</COLGROUP>

The <COLGROUP> and </COLGROUP> tags have no content or code between them if the properties put forward in the <COLGROUP> tag are to apply to each column in the group. You can also use the <COL> tag between <COLGROUP> and </COLGROUP> to specify column properties for a subgroup of the larger group.

Attributes:

<COLGROUP> can take the following attributes:

  ALIGN—Controls the horizontal alignment within the column group. ALIGN can take on values of LEFT, RIGHT, CENTER, JUSTIFY, or CHAR.
  CHAR—Specifies the alignment character for when ALIGN=”CHAR” is used.
  CHAROFF—Prescribes the offset distance from the alignment character.
  SPAN—Tells the browser how many columns are in the group.
  VALIGN—Controls the vertical alignment in the column group. VALIGN can take on values of TOP, MIDDLE, BOTTOM, or BASELINE.
  WIDTH—Specifies how wide (in pixels or in terms of relative width) the enclosed columns should be.

Example:

<COLGROUP SPAN=3 ALIGN=”CENTER” VALIGN=”TOP”>
</COLGROUP>
<TR>
<TD>Column 1 - center/top alignment</TD>
<TD>Column 2 - center/top alignment</TD>
<TD>Column 3 - center/top alignment</TD>
<TD>Column 4 - default alignment</TD>
</TR>
</TFOOT>

Related Tags:

The <COL> tag can be used between the <COLGROUP> and </COLGROUP> tags to refine column properties for a subset of the column group.

<COL>

Type:

Standalone

Function:

Specifies properties for a column or columns within a group.

Syntax:

<COL SPAN=”number_of_columns” WIDTH=”width_of_column_subgroup”
 ALIGN=”LEFT|RIGHT|CENTER|JUSTIFY”
 VALIGN=”TOP|MIDDLE|BOTTOM|BASELINE”
 CHAR=”alignment_character” CHAROFF=”alignment_character_offset”>

Attributes:

<COL> can take the following attributes:

  ALIGN—Controls the horizontal alignment within the column cells. ALIGN can take on values of LEFT, RIGHT, CENTER, JUSTIFY, or CHAR.
  CHAR—Specifies the alignment character for when ALIGN=”CHAR” is used.
  CHAROFF—Prescribes the offset distance from the alignment character.
  SPAN—Tells the browser how many columns to which to apply the property.
  VALIGN—Controls the vertical alignment in the column cells. VALIGN can take on values of TOP, MIDDLE, BOTTOM, or BASELINE.
  WIDTH—Specifies the width (in pixels or in terms of relative width) of the column or column group.

Example:

<TABLE BORDER=1>
<COLGROUP>
   <COL ALIGN=CENTER>
   <COL ALIGN=RIGHT>
</COLGROUP>
<COLGROUP>
   <COL ALIGN=CENTER SPAN=2>
</COLGROUP>
<TBODY>
   <TR>
      <TD>First column in first group, center aligned</TD>
      <TD>Second column in first group, right aligned</TD>
      <TD>First column in second group, center aligned</TD>
      <TD>Second column in second group, center aligned</TD>
   </TR>
</TBODY>
</TABLE>

<TR>

Type:

Container

Function:

Defines a row of a table, table header, table footer, or table body.

Syntax:

<TR ALIGN=”LEFT|RIGHT|CENTER|JUSTIFY|CHAR”
  VALIGN=”TOP|MIDDLE|BOTTOM|BASELINE”>
...
</TR>

Attributes specified in a <TR> tag apply only to the row that the tag is defining and will override any default values.

Attributes:

The <TR> tag can take the following attributes:

  ALIGN—Controls the horizontal alignment within the cells in the row. ALIGN can take on values of LEFT, RIGHT, CENTER, JUSTIFY, or CHAR.
  CHAR—Specifies the alignment character for when ALIGN=”CHAR” is used.
  CHAROFF—Prescribes the offset distance from the alignment character.
  VALIGN—Controls the vertical alignment of the cells in the row. VALIGN can take on values of TOP, MIDDLE, BOTTOM, or BASELINE.

Example:

<TR BGCOLOR=”white” VALIGN=”TOP”>
<TD>Phone</TD>
<TD>Extension</TD>
<TD>Fax</TD>
...
</TR>

Related Tags:

Cells in a row are defined using the <TD> or <TH> tags.


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.