Re: Styling table columns--why so limited?

Dan Delaney wrote:
> I can see how width and visibility would be determined during the layout 
> stage. But how is it that border and background /can/ be determined 
> during stage 3 but color, font-weight, text-align, et.al. cannot?

Those can all be determined during stage 3.  The problem Hixie points 
out is that to get sane behavior for the properties you list (which are 
all inherited), you need to determine them during stage 2, not stage 3.

If you meant "2" instead of "3", then in fact border and background are 
not "determined" during stage 2 when we're talking about table columns. 
  Border is determined during stage 3 (the only thing column borders 
affect is the collapsing border model, and collapsing borders are just 
treated weirdly during layout, not style resolution), and background is 
stage 4 (it only affects painting).

To test this, try the following:

<html>
<body>
<table style="border-color: green">
<col style="border: 10px solid red">
<tr style="border-color: inherit">
   <td style="border-color: inherit">
    <div style="border-color: inherit; border-style: solid;
                border-width: 5px"></div>
   </td>
</tr>
</table>
</body>
</html>

The border color of the div should be green, while the border of the 
cell will be nonexistent in the separated border model and red in the 
collapsed border model.

> Wouldn't you need to know which cell applies to which column in order to 
> know what background-color to apply to it?

Yes, but by the time you're painting backgrounds you've finished layout.

Hope that helps,
Boris

Received on Tuesday, 30 March 2004 17:01:43 UTC