[whatwg] Table integrity and conformance

Lachlan Hunt lachlan.hunt at lachy.id.au
Fri Oct 27 06:17:16 PDT 2006

Ian Hickson wrote:
> I think it would be good to require table integrity. Specifically I think 
> overlapping cells would be a MUST NOT.

That's fine for document conformance, but what about how browsers will 
handle it?  Is the spec still going to require browsers to render 
overlapping cells, or would it be possible to resolve this difference 
between HTML and XHTML rendering, as documented in CSS 2.1 [1]?

Do you have any statistics on the number of sites that depend on 
overlapping cells in HTML?  Could that rendering be removed from 
standards mode (but left in quirks mode) without breaking a significant 
number of pages?

I think the spec should define an algorithm to unambiguously determine 
which rows and columns a cell fits into.  If browsers can calculate 
that, there are 2 benefits I can think of.

1. It would make it easier to implement a :column() pseudo-class (as 
discussed on www-style a few months ago) which would select a cell based 
on it's semantic position.
2. Assistive technology can more accurately determine the header cells, 
especially in non-conforming tables.  (This algorithm should also be 
well defined, see below)

> I don't think there's a problem with missing table cells at the end of rows 
> i.e. a ragged table is fine). 


> I think cells extending (via colspan/rowspan) into columns or rows that 
> contain no cells other than extended cells should be at least a SHOULD 
> NOT, maybe a MUST NOT.

I don't think it should be a must not.  Here's a use case for where it's 
useful to span cells across multiple columns like that.

Consider a online TV guide where columns represent the time and rows 
represent the channel.  The headers for the times could be split into 
half hour time slots, because most shows take up units of half an hours. 
  However, there are some programs that only take 5 or 10 minutes (e.g. 
lottery draws or short news breaks) and to allocate such programs a full 
half hour slot in the table wouldn't be very useful.  Consider this 
markup demonstrating this:


> I don't know whether we'll keep the requirement that TFOOTs be above 

I agree.  I think that requirement is silly, and most people who I've 
seen use tfoot inevitably put it at the end of the table.  It can also 
be more convenient in a generated table, where a server side script is 
calculating something from the contents of each row in tbody (e.g. a 
total) and then outputting that total in the tfoot.

> COLGROUP span="" will be illegal if the COLGROUP has COLs. COLs 
> and COLGROUPs will probably have a SHOULD NOT requirement about spanning 
> into columns with no actual cells.


> headers="" will have a MUST requirement to point to TH elements in the 
> same table, and will probably only be allowed on TDs.

Maybe.  What about in tables where one th is like a subheading of the 
one above?

> scope="" will probably only be allowed for THs. Maybe it should be REQUIRED for THs that 
> aren't in obvious locations (first row, first column, or whatever).

Maybe.  I think the spec should explicitly define how to determine which 
header cells are associated with each cell.  IIRC, the HTML 4 spec does 
define an algorithm like that, so maybe it could be improved.

> It might be interesting to have some sort of testing with the "axis" 
> attribute too, or maybe we should drop it.

I've never used axis.  I've never seen it used by anyone else.  It 
didn't seem to show up in the Google Web Stats you did previously.  I 
don't know anyone who understands how it can be used or what it's useful 
for.  I don't know any UA, including assistive technology, that supports 
it (though that needs to be verified).  I see no compelling reason to 
keep it, despite the theoretical benefits given in the HTML4 spec.

> (Indeed maybe we should drop some of the others, too.)

I'd say drop all of these because they're either presentational or not 

* align
* valign
* char
* charoff
* width
* height
* border
* frame
* rules
* cellspacing
* cellpadding

All of these attributes should be kept, because they are supported and 

* summary (supported by screen readers)

TH and TD
* abbr (I think that's supported by screen readers, but need to verify)
* headers
* scope
* rowspan
* colspan

* span

[1] http://www.w3.org/TR/CSS21/tables.html#q7

Lachlan Hunt

More information about the whatwg mailing list