The cover of The Complete Idiot's Guide to Create a Web Page The Complete Idiot's HTML Tag Reference

| Index | Previous Tag: <CODE> | Next Tag: <COLGROUP> |


<COL>

Sets properties for an entire column within a table.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 3.0 and later Not supported
Notes:
  • This tag must appear within a <COLGROUP> structure.
Attributes:
ALIGN = "Text"
The horizontal alignment of text within the column.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

Notes:

  • Possible values: LEFT, CENTER, RIGHT.

BGCOLOR = "Color value"
The color to use for the column background.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported 4.0 and later Not supported

Notes:

  • Use either an RGB value or a color name.
  • Try to use a color that's compatible with the color you're using for your column text.

CHAR = "Text (single character)"
The common character upon which each cell in the column will be aligned.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later Not supported Not supported

Notes:

  • The default character is the decimal point.

CHAROFF = Positive integer
The amount of space, in pixels, between the column's left edge and the first occurrence of the character specified by CHAR.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later Not supported Not supported

Notes:

  • If you use the <BDO> tag to change the text direction to right-to-left, then this offset is measured from the right edge of the column.

CLASS = "Text"
The style sheet class used by the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

Notes:

  • You can specify two or more classes; be sure to separate each class name with a space.

ID = "Text"
An alphanumeric string that uniquely identifies the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

Notes:

  • Although you can use letters and numbers for the ID, the first character must be a letter.

LANG = "Text"
The language used by the tag's attribute values and text content.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

SPAN = Positive integer
The number of columns that are affected by the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported 3.0 and later Not supported

STYLE = "Text"
The style or styles to use with the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

Notes:

  • If you enter multiple style properties, separate each one with a semi-colon (;).

VALIGN = "Text"
The vertical alignment of text within the column.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

Notes:

  • Possible values: TOP, MIDDLE, BOTTOM, BASELINE.

WIDTH = Positive integer
Specifies the column's width, in pixels.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 3.0 and later Not supported

Example:
<TABLE BORDER>
<COLGROUP>
<COL ALIGN="LEFT">    <--This applies to the first column
<COL ALIGN="LEFT">    <--This applies to the second column
</COLGROUP>
<COLGROUP>
<COL ALIGN="RIGHT">   <--This applies to the third column
<COL ALIGN="RIGHT">   <--This applies to the fourth column
</COLGROUP>
<TH>The first column</TH>
<TH>The second column</TH>
<TH>The third column</TH>
<TH>The fourth column</TH>
<TR>
<TD>Left-aligned</TD>
<TD>Left-aligned</TD>
<TD>Right-aligned</TD>
<TD>Right-aligned</TD>
</TR>
<TR>
<TD>Left-aligned</TD>
<TD>Left-aligned</TD>
<TD>Right-aligned</TD>
<TD>Right-aligned</TD>
</TR>
</TABLE>
How It Looks:
The first column The second column The third column The fourth column
Left-aligned Left-aligned Right-aligned Right-aligned
Left-aligned Left-aligned Right-aligned Right-aligned

| Index | Previous Tag: <CODE> | Next Tag: <COLGROUP> |