W3C home > Mailing lists > Public > www-style@w3.org > April 2004

RE: Styling table columns--why so limited?

From: <Matthew.van.Eerde@hbinc.com>
Date: Mon, 5 Apr 2004 10:21:18 -0700
Message-ID: <B8B9965E9A4B1948839F37ADCB58E9D58130CB@exchange.hbinc.com>
To: ian@hixie.ch
Cc: www-style@w3.org

> From: Ian Hickson [mailto:ian@hixie.ch]
> On Mon, 5 Apr 2004 Matthew.van.Eerde@hbinc.com wrote:
> >
> > And the CSS as such:
> > /* either */
> > #ian td[column=~2] { display: none; }
> 
> But that doesn't make sense: How can a td be in a column, if 
> it isn't a
> table-cell?

Because it has a column="2" attribute.  Once display: none is applied, it
becomes a non-entity, but it still inherits all the stylings of its classes.
There is a first interpretive pass which is CSS-blind to apply row= and
column= attributes to <td>s regardless of other stylings.  Only then is
there a second CSS pass to apply stylings to cells based on their column=
and row= attributes.

As you observe above, the second pass may very well knock certain cells out
of the sky.  That's fine.  The next cell remains in column three, though -
it doesn't slide to the left to fill the vacated space.  Once column="3" is
applied, the second pass is powerless to change it.  DOM can change it (at
your own risk) via something like td.column++;

> If you have:
> 
>    <a>
>     <b/>
>     <c/>
>     <b/>
>    </a>
> 
> ...and:
> 
>    a { display: table; }
>    b { display: table-cell; }
>    c { display: block; }
> 
> ...then there are three columns (according to CSS2). But you can't know
> this when you do the cascade, you only know it _after_ you have done the
> cascade. So then:
> 
>    b[column=3] { color: blue; }
> 
> ...could never be matched, since you need to know that _before_ the
cascade.

Yes, indeed.  Pure CSS, as a tree-only model, allows for only row-level
stylings.  (Or presumably only column-level stylings.)  This is because you
are thinking of rows and columns as container objects.  If you want to allow
simultaneous row- and column-level stylings, you can NOT think of rows and
columns as objects - you HAVE to think of them as attributes.

Actually that's not entirely true.  If you allow for a notion of sym-links,
you can get away with thinking of rows and columns as objects.  But I don't
propose that because that begins to get kind of silly-complicated.

> -- 
> Ian Hickson                                      
> )\._.,--....,'``.    fL
> U+1047E                                         /,   _.. \   
> _\  ;`._ ,.
> http://index.hixie.ch/                         
> `._.-(,_..'--(,_..'`-.;.'
> 
Received on Monday, 5 April 2004 13:21:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:28 GMT