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

Re: HTML or XHTML - why do you use it?

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 7 Jan 2003 08:19:11 +0000 (GMT)
To: David Woolley <david@djwhome.demon.co.uk>
Cc: "www-html@w3.org" <www-html@w3.org>
Message-ID: <Pine.LNX.4.21.0301070816370.4082-100000@dhalsim.dreamhost.com>

On Tue, 7 Jan 2003, David Woolley wrote:
>>    explicitly include <tbody> elements
> I don't understand this one.  Surely the DOM for an HTML table always contains
> tbody's as tr is not allowed as a direct descendant of table, so a proper
> DOM has to include tbody elements, and that is what gets styled.

In XHTML, <tbody>s are optional. In HTML, they are required, but their
start and end tags are optional. This means that the following:

     <td> </td> 

...is valid in both, but different CSS rules match depending on the parse

   table > tr > td::before { content: 'Parsed as XHTML'; }
   table > tbody > tr > td::before { content: 'Parsed as HTML'; }

Similar (but even harder to track down) problems occur with DOM that
navigates through tables without realising that this difference exists.

Ian Hickson                                      )\._.,--....,'``.    fL
"meow"                                          /,   _.. \   _\  ;`._ ,.
http://index.hixie.ch/                         `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 7 January 2003 03:19:13 UTC

This archive was generated by hypermail 2.4.0 : Thursday, 30 April 2020 16:20:48 UTC