Geek's Portal For Computers Graphics Operating Systems Multi-Media Networking Programming Data Format and  News
[ Start Page ] [ Contacting ] [ About ] [ Link To Us ] [ Geek Gear ] Fri, May 17 2013 
Free Internet Tools by web-geek.com Internet Tools
Administrator Tools
Name Server Look Up
Ping Test
Who Is
Trace Route

Web Developer Tools
Web Safe Colors
HTML Character Map
PopUp Generator
Body Color CSS v1.0
Browser Information
Meta Tag Generator
Keywords Generator
Link Popularity
JavaScript Escape / Unescape Converter
JavaScript Drop Down Menu Builder
Web / Virtual Hosting Directory

Reference Documention
HTML 4.0 Reference

Reference Tables
Character Conversion Table
Domain Name Suffixes

Cheat Sheets
Vi / Vim Basic Commands


WEB-GEEK.COM's Feature Sites Feature Sites
oGobogo Internet Search Directory
News.web-geek.com Internet News Directory
Pdawebgeek.com PDA Friendly Web Directory
Games.web-geek.com Free Online Games


folder HTML 4.0

COL - Table Column

Syntax <COL>
Attribute Specifications
  • SPAN=Number (number of columns)
  • WIDTH=MultiLength (width of each column)
  • ALIGN=[ left | center | right | justify | char ] (horizontal alignment of cells)
  • CHAR=Character (alignment character for cells)
  • CHAROFF=Length (alignment character offset)
  • VALIGN=[ top | middle | bottom | baseline ] (vertical alignment of cells)
  • common attributes
Contents Empty
Contained in COLGROUP, TABLE

The COL element defines attributes common to a table column. If used, COL must be after the optional CAPTION and before the optional THEAD in the TABLE. Unlike COLGROUP, COL does not group columns structurally; it merely defines attributes common to all cells in one or more columns.

COL's SPAN attribute defines the number of columns that will share the COL element's other attributes; the default value is 1. COL may be contained directly in the TABLE element or it may be contained within a COLGROUP. If COL is in a COLGROUP, the COL's attributes override those of the COLGROUP for the columns spanned by COL.

The next example uses COL elements within COLGROUPs to assign a different CLASS to each column:

<TABLE SUMMARY="This table gives the character entity reference,
                decimal character reference, and hexadecimal character
                reference for 8-bit Latin-1 characters, as well as the
                rendering of each in your browser.">
  <COLGROUP CLASS="character-description">
  <COLGROUP>
    <COL CLASS=entity>
    <COL SPAN=2 CLASS=numeric>
  <COLGROUP>
    <COL CLASS="entity-rendering">
    <COL CLASS="decimal-rendering">
    <COL CLASS="hex-rendering">
  <THEAD>
    <TR>
      <TH SCOPE=col ROWSPAN=2>Character</TH>
      <TH SCOPE=col ROWSPAN=2>Entity</TH>
      <TH SCOPE=col ROWSPAN=2>Decimal</TH>
      <TH SCOPE=col ROWSPAN=2>Hex</TH>
      <TH SCOPE=colgroup COLSPAN=3>Rendering in Your Browser</TH>
    </TR>
    <TR>
      <TH SCOPE=col>Entity</TH>
      <TH SCOPE=col>Decimal</TH>
      <TH SCOPE=col>Hex</TH>
    </TR>
  </THEAD>
  <TBODY>
    <TR>
      <TD SCOPE=row>non-breaking space</TD>
      <TD>&amp;nbsp;</TD>
      <TD>&amp;#160;</TD>
      <TD>&amp;#xA0;</TD>
      <TD>&nbsp;</TD>
      <TD>&#160;</TD>
      <TD>&#xA0;</TD>
    </TR>
    ...
  </TBODY>
</TABLE>

COL also takes a number of presentational attributes, many of which cannot be completely replaced by style sheets. Since few browsers support COL, authors may wish to specify these attributes on the TD or TH elements instead.

The WIDTH attribute specifies a width for each column spanned by COL. The value must be a number in pixels, a percentage of the table width, or a relative length expressed as i* where i is an integer. A column with WIDTH="3*" will be allotted three times the width of a column with WIDTH="1*". The value 0* is equivalent to the minimum width necessary for the column's contents.

The ALIGN attribute specifies the horizontal alignment for each cell in the spanned columns. Possible values are left, center, right, justify, and char. ALIGN=char aligns a cell's contents on the character given in the CHAR attribute. The default value for the CHAR attribute is the decimal point of the current language--a period in English. The CHAROFF attribute specifies the offset to the first occurrence of the alignment character. The attribute's value is a number in pixels or a percentage of the cell's width; CHAROFF="50%" centers the alignment character horizontally in a cell.

The VALIGN attribute specifies the vertical position of a cell's contents. Possible values are:

  • top, which positions data at the top of the cell;
  • middle, the default value, which centers the cell data vertically;
  • bottom, which positions data at the bottom of the cell;
  • baseline, which specifies that the first line of each cell in the row with VALIGN=baseline should occur on a common baseline.

More Information

Copyright © 1998 by Liam Quinn. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/).


Sponsor Sponsor


  © 1999-2006, web-geek.com a Geek Boy Enterprises, Inc. website terms and conditions of use [ Start Page ] [ Contacting ] [ About ] [ Link To US ]