Re: Possible Inconsistency in HTML 4.01 Spec

On Fri, Aug 6, 2010 at 10:27 AM,  <fagricipni@fagricipni.com> wrote:
> In "11.2.4 Column groups" of the HTML 4.01 spec under the section "The COL
> element" it says, speaking of the COL element: "They may appear inside or
> outside an explicit column group (i.e., COLGROUP element)."  However,
> under "11.2.1 The TABLE element", the quote from the DTD says: "11.2.1 The
> TABLE element" and the DTDs it says: "<!ELEMENT TABLE - - (CAPTION?,
> (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)>".  If I understand "3.3.3
> Element declarations" correctly, "(COL*|COLGROUP*)" means that a TABLE may
> *directly* contain a set of COLGROUPs or a set of COLs, but not both.  To
> get the behavior specified by the text under, "They may appear inside or
> outside an explicit column group (i.e., COLGROUP element)", it should be
> "(COL|COLGROUP)*".

Earlier in the section, it says: "A table may either contain a single
implicit column group (no COLGROUP element delimits the columns) or
any number of explicit column groups (each delimited by an instance of
the COLGROUP element)."  So the DTD probably reflects the intended
behavior.

However, HTML 4.01 is no longer maintained by anyone, as far as I
know.  HTML5 requires that all <col> elements be contained in a
<colgroup>, but it permits <colgroup> to be omitted in the text/html
syntax if there's only one in the table (browsers will add it to the
DOM themselves):

http://dev.w3.org/html5/spec/tabular-data.html#the-col-element
http://dev.w3.org/html5/spec/syntax.html#optional-tags

One of the advantages of HTML5 is that it clearly separates normative
and informative text, and avoids repeating anything in normative text,
so that apparent contradictions like this don't arise.

Received on Monday, 9 August 2010 16:59:53 UTC