CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmasters (CSS Editor / HTML Editor / CSS Validator / HTML Tutorial)
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersHome
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersCSS Editor
SEO Report For Windows - The ultimate website ranking checker / search engine optimization toolkit!SEO Report (New)
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersCSS Download
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersOrder
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersSupport
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersNews
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersAwards
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersContact
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersLinks
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersAbout
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersCSS Validator
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersCSS Tools
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersCSS FAQ
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersCSS Tutorial
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersCSS Articles
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersCSS Resources
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersCSS Layouts
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersHTML Tidy
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersHTML Tutorial
   
Home » HTML Tutorial » COLGROUP - Table Column Group


COLGROUP - Table Column Group


Summary

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

Details

The COLGROUP element defines a column group in a table. If used, COLGROUP must be after the optional CAPTION and before the optional THEAD in the TABLE. The structural divisions defined by COLGROUP allow authors to easily suggest a presentation for groups of columns through style sheets.

COLGROUP's SPAN attribute defines the number of columns in the group; the default value is 1. A number of other attributes are permitted on COLGROUP, and these are shared among the cells of the group. COLGROUP may contain COL elements that define attributes for the cells of individual columns, overriding attributes defined for the column group. The SPAN attribute should not be used if the COLGROUP contains any COL elements.

The next example features three column groups to structurally divide the table into three parts. The first part is a single column that gives the description of a character. The second part consists of three columns giving different ways of representing the character in HTML. The third part consists of three columns with renderings of the character in the user's browser.

<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>  <COLGROUP SPAN=3>  <COLGROUP SPAN=3>  <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>

In place of the <COLGROUP SPAN=3> tag in the preceding example, a COLGROUP with three COL elements could have been used:

<COLGROUP>  <COL CLASS=entity>  <COL CLASS=decimal>  <COL CLASS=hex></COLGROUP>

Here we have used the CLASS attribute to distinguish the individual columns of the group, allowing us to easily suggest different presentations for the columns through style sheets.

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

The WIDTH attribute specifies a width for each column in the group. 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 column group. 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


Adapted by style-sheets.com, maker of Style Studio, powerful CSS Editor for Windows.

Copyright © John Pozadzides and Liam Quinn. All rights reserved.


Home » HTML Tutorial » COLGROUP - Table Column Group

 

Related Links :


Acknowledgements    |    Site Map    |    FAQ    |    Website Ranking Checker    |    HighDots Forums
Copyright OverZone Software 2000-2008. All rights reserved.


html 4.01 | css 2 (W3C) | css 2