COLGROUP and COL, TR and TBODY: part of my review of 3.15 Tabular data

On Aug 9, 2007, at 12:49 PM, Lachlan Hunt wrote:

>
> Robert Burns wrote:
>> Consider allowing COL elements as a child of TABLE instead of only  
>> as a grandchild (child of COLGROUP). It's not clear what  
>> disallowing COL as a child of TABLE solves.
>
> IIRC, the reason for requiring the colgroup element is for better  
> compatibility with IE, which implies colgroup element when it  
> encounters an col element anyway.  Since the start and end tags for  
> colgroup are both optional, it can be omitted from the markup in  
> HTML, though it is a little more inconvenient for XHTML.
>
> I have no strong opinion about how to deal with this either way,  
> though since XHTML1 didn't require colgroup, perhaps XHTML5  
> shouldn't either.

Based on this and some research I'm doing into this, I think I have  
to reconsider my request to consider letting COl descend directly  
from TABLE. Back in July [1], we had some discussions bout trying to  
smooth things over between the XML and text/html serializations. In  
that thread, I had misunderstood the rtequired COLGROUP as needing to  
wrap each COL, but now I understand that a single COLGROUP would meet  
the requirement. So I now think that use-case is strong enough to  
justify requiring an explicit COLGROUP and an explicit TBODY both in  
the XML serialization (TBODY is basically required in HTML with  
optional start and end tag omissions already; COLGROUP would be a  
separate issue). Adding those two sets of tags in XML is hardly a  
burden for authors and it makes the DOM trees more consistent between  
the two de-serializations. I also think simply requiring COLGROUP  
even without any explicit COL elements would be a good idea to  
encourage more explicit column dimensions.  Something like:

"Documents must ensure that the COLGROUP and COL elements after any  
optional CAPTION element accurately declare the number of columns on  
a table."

This will help with incremental rendering. If a COLGROUP is already  
required (with either @span set correctly or explicit COL elements)  
then the addition of COL in XML is already going to be within either  
the single COLGROUP or additional ones at the author's discretion. We  
might even want to make the COLGROUP required in the text/html  
serialization (also to ease any migrations). Especially if IE is  
already inferring a COLGROUP when none is there (COLGROUP has  
optional end tag omission, but not optional start tag omission).  
Requiring COLGROUP in text/html could lead to improved cross-browser  
compatibility if IE is alone in inferring the COLGROUP around any COL.

Take care,
Rob

[1]: <http://lists.w3.org/Archives/Public/public-html/2007Jul/0511.html>

Received on Friday, 10 August 2007 09:56:12 UTC