W3C home > Mailing lists > Public > www-html@w3.org > January 1999

COL and COLGROUP

From: L. David Baron <dbaron@fas.harvard.edu>
Date: Thu, 14 Jan 1999 16:51:19 -0500 (EST)
Message-Id: <199901142151.QAA26838@login6.fas.harvard.edu>
To: www-html@w3.org
The wording of the spec and the DTD seem to disagree over COL and
COLGROUP elements.

Section 11.2.4 of html40 [1] says:

   The COL element allows authors to group together attribute
   specifications for table columns. The COL does not group columns
   together structurally -- that is the role of the COLGROUP element.
   COL elements are empty and serve only as a support for attributes.
   They may appear inside or outside an explicit column group (i.e.,
   COLGROUP element).

According to the last sentence, it would seem that the following
markup would be valid:

<table>
 <colgroup>
  <col>
  <col>
 </colgroup>
 <col>
 <thead>
  <tr>
... rest of table...
</table>

However, both the loose [2] and strict [3] DTD's say:

<!ELEMENT TABLE - -
     (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)>

This means that there can either be any number of COL elements, or any
number of COLGROUP elements (which *contain* COL elements).  However,
they cannot coexist as *direct children* of TABLE.  This makes the above
markup invalid.

Which is correct?  Should the DTD read:

<!ELEMENT TABLE - -
     (CAPTION?, (COL|COLGROUP)*, THEAD?, TFOOT?, TBODY+)>

or is the text in 11.2.4 wrong (or am I misinterpreting it)?

David Baron

[1] http://www.w3.org/TR/REC-html40/struct/tables.html#h-11.2.4.2
[2] http://www.w3.org/TR/REC-html40/sgml/loosedtd.html
[3] http://www.w3.org/TR/REC-html40/sgml/dtd.html

--------------------------------------------------------------------
L. David Baron         | Freshman, Harvard
dbaron@fas.harvard.edu | < http://www.fas.harvard.edu/~dbaron/ >
--------------------------------------------------------------------
Received on Thursday, 14 January 1999 16:51:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:38 GMT