http://www.w3.org/TR/html4/struct/tables.html#h-22.214.171.124 describes the rules. There is a bugzilla bug
in Mozilla that has much discussion about ideas for how to implement this in a CSS-compatible way.
Apple Bug: rdar://3481332/
*** Bug 5327 has been marked as a duplicate of this bug. ***
Presumably, the Mozilla bug is <https://bugzilla.mozilla.org/show_bug.cgi?id=2212>.
No, wrong bug. There's another mozilla bug specifically about the double-inheritance model of going to the columns to honor alignment.
We should probably have a bug covering the charoff stuff too though.
Note the low digit of the Mozilla bug (under 1000!). This is a tough nut to crack.
Here is my idea for a possible approach to cracking the 2d-inheritance problem:
(1) For cols/colgroups, keep a cache of every property that is inherited by default that was explicitly set on the col/colgroup during the course of style computation.
(2) When a cell's column is determined, compare every inheritable property set by the col/colgroup with the cell's values. For each property that is different, determine the originator of the cell's property value.
(3) If the originator is higher than the table-row-group, then inherit from the col/colgroup instead. Build up a final cache of all such properties.
(4) Re-resolve the cell's style (and descendants) using this final cache.
This approach should not cost as long as no styles are set on the columns. You will start paying a double resolve performance hit, though, if styles are set on the columns, and also style sharing will have to be disabled on such a table. Either that or the special column-hybrid style could be held separately by the cell to allow the original styles to still be shared.
We could just cherry-pick a small set of styles, e.g., font, color, text-align, vertical-align, and just cache the originator of these properties all the time. That would make this even easier (and although it is less general, would probably be sufficient to cover most desired uses).
Created attachment 13461 [details]
Proposal for a way to correct this bug and support these HTML4 and Internet Explorer features
This is a proposal for dealing with HTML presentational hints for table elements and imporving CSS 2 support. It proposes relating table-cell boxes to two rather thn only one parent. Table-cells would descend from both the row and the column parents. In this way descendant (contextual) selectors and inheritance would allow column-based styling within tables.
* table-cell boxes are matched with table-column boxes through a initialColumnIndex variable.
* the matching table-columns can serve as selectors of the descended table-cells (cascade conflicts are determined by declaration/ rule order rather than extending specificity as in an earlier draft)
* the CSS2 inheritance algorithm is extended to allow table-cells to iherit from either the table-row or the table-column (depending on the property being inherited)
The ealier draft went out via email over the WebKit listserve.
Created attachment 13462 [details]
Sample CSS2 stylesheet to show how some HTML presentational attributes could be implemented with this extended CSS proposal
Reassigning to webkit-unassigned for more exposure.
There's just "underexposure" since four years now!