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

Spec and transitional DTD disagree on table cell width?

From: Morten Wang <warnckew@online.no>
Date: 09 Feb 1999 15:48:06 +0000
To: www-html@w3.org
Message-ID: <wk90e7wpc9.fsf@online.no>
Greetings to all,

and pardon me for jumping in here without proper presentation et all.

last Friday (1999-02-05) I ran a page through W3C's validator and
noticed that the page validated perfectly even though the spesification
states that table cell widths are only in pixels, not percentages.

I thought this was a bug in the validator (me feeling that the HTML 4.0
spec was clear when it came to table cell widths, and me being unable to
read the DTD) and I posted to the www-validator list asking if it was a
bug.  the fact that it wasn't a bug in the validator was pointed out to
me, and I figured that this list would be the next place to ask the

I _have_ searched the mailing list archives looking for this, but I was
unable to find any posts regarding this issue.  here's what I have:

the spec, section 11.2.6 Table cells: The TH and TD elements states:

width = pixels [CN]

and if you follow the link 'pixels' you arrive at (section 6.6 Lengths):

1.Pixels: The value ( %Pixels; in the DTD) is an integer that represents
  the number of pixels of the canvas (screen, paper). Thus, the value
  "50" means fifty pixels.

this, as I understand it, means that table cells can only take pixel
widths.  lets then have a look at the Transitional DTD (section 22
Transitional Document Type Definition):

<!ENTITY % Pixels "CDATA" -- integer representing length in pixels -->


<!ATTLIST (TH|TD)                      -- header or data cell --
[my snippage]

  width       %Pixels;       #IMPLIED  -- width for cell --

[my snippage again]

these two combined makes a document with percentage values in table cell
widths validate just as nicely as any other document.  even though, in
my opinion there should be no misunderstanding that percentage values in
table cell widths is not in conformance with the HTML 4.0 specification.

actually, as Jukka Korpela demonstrated to me with a document he had
made you could say 'width="anything goes"' and still get away with it.

changing the line where %Pixels is defined as CDATA so that %Pixels is
defined as NUMBER corrects the error.

should the DTD be updated or am I just too picky on pixel widths?


Received on Tuesday, 9 February 1999 09:44:26 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:05:49 UTC