Connected: An Internet Encyclopedia
RFC 1942 - 4.7. The COLGROUP Element

Top: Connected: An Internet Encyclopedia
Up: Requests For Comments
Up: RFC 1942
Up: 4. A walk through the Table DTD
Prev: 4.6. Table Captions
Next: 4.8. The COL Element

### 4.7. The COLGROUP Element

       <!ELEMENT colgroup - O (col*)>

       <!ATTLIST colgroup
               %attrs;                    -- id, lang, dir and class --
               span    NUMBER   1         -- default number of columns in --
                                          -- group --
               width   CDATA    #IMPLIED  -- default width for enclosed --
                                          -- COLs --
               %cell.halign;              -- horizontal alignment in --
                                          -- cells --
               %cell.valign;              -- vertical alignment in cells --
               >

The COLGROUP element acts as a container for a group of columns, and allows you to set default properties for these columns. In the absence of a COLGROUP element, all columns in the table are assumed to belong to a single column group. Each COLGROUP element can contain zero or more COL elements. COLGROUP requires a start tag, but the end tag may be omitted. This is useful when defining a sequence of COLGROUP elements, e.g.

           <TABLE FRAME=BOX RULES=COLS>
             <COLGROUP>
               <COL WIDTH="1*">
               <COL WIDTH="2*">
             <COLGROUP>
               <COL WIDTH="1*">
               <COL WIDTH="3*">
             <THEAD>
               <TR> ...
           </TABLE>

COLGROUP elements can be used with the following attributes:

ID, CLASS, LANG and DIR
  See earlier description of common attributes.

SPAN
  A positive integer value that specifies a default for how many columns are in this group. This attribute should be ignored if the COLGROUP element contains one or more COL elements. It provides a convenient way of grouping columns without the need to supply COL elements.

WIDTH
  Specifies a default width for each of the grouped columns, see standard units. In addition, the "*" suffix denotes relative widths, e.g.

                  width=64        width in screen pixels
                  width=0.5*      a relative width of 0.5

  Relative widths act as constraints on the relative widths of different columns. If a COLGROUP element specifies a relative width of zero, all of the columns in the group should be set to their minimum widths, unless they are associated with a COL element with an overriding WIDTH attribute. When widths are given in absolute units, the user agent can use these to constrain the width of the table. The "*" suffix is used to simplify importing tables from the CALS representation.

ALIGN, CHAR, CHAROFF and VALIGN
  Specify values for horizontal and vertical alignment within table cells. See inheritance order of alignment properties.

Next: 4.8. The COL Element

Connected: An Internet Encyclopedia
RFC 1942 - 4.7. The COLGROUP Element