RE: HTML vs. CSS on the <table>

> From: Mikko Rantalainen [mailto:mira@cc.jyu.fi]
> Matthew.van.Eerde@hbinc.com wrote:
> >>From: Ernest Cline [mailto:ernestcline@mindspring.com]
> >>
> >>>This would allow row/column styling trivially via 
> constructs such as
> >>[...]
> >>
> >>Except explicitly giving the cell indices for every single cell
> >>is not trivial. 
> > 
> > Depends on the table.  For sparse tables, it could actually be easier to
> > read and understand this way (think of a table representing a battleship
> > board, for example)
> 
> SVG would be much better choice in most cases like this, IMO.
 
> > I suppose in such an instance it is necessary to put rows= and columns=
> > attributes on the grid as well:
> > 
> > <grid class="battleship" rows="10" columns="10">
> > <cell class="vertical aircraft-carrier" rows="5 6 7 8" columns="3">
> > <cell class="horizontal cruiser" rows="2" columns="3 4 5">
> > ...
> > </grid>
> 
> I agree that there're some cases where such table-like construct 
> would be nice but as a general case, there're just way too much 
> problems. How about if I add a cell to your example grid:
> 
> <cell class="crashed aircraft-carrier" rows="2 4" columns="2 5 7" />
> 
> Should that be rendered like 6 discrete one cell sized elements or 
> what? How are you going to formally deny such constructs?

The same way <td colspan="-4"> is denied - such a construct violates the
specification.  How to handle this is a browser decision.  Possible
alternatives - fill in the missing gaps (in your example, treat it as if it
were rows="2 3 4" columns="2 3 4 5 6 7") or stop interpreting at the first
discontinuity (rows="2" columns="2")
 
> As Ernest Cline wrote in thread "Re: Styling table columns--why so 
> limited?" (Message-ID: <410-22004323023428187@mindspring.com>), the 
> problem is that the 'display' property is used to designate the COL 
> element as table column and the very same property is used to toggle 
> rendering of the element on/off (display: none). So any logic that 
> depends on special values of 'display' property (like 'table-column' 
> or 'table-cell') cannot really work (setting display:none to a COL 
> element would remove *that* element from the table structure but it 
> would leave all the respective 'table-cell' elements behind. If any 
> cell had colspan or rowspan for multiple cells, expect serious 
> problems). I'm afraid that there isn't a way to solve this using 
> CSS2 model for tables.
> 
> If tables required empty placeholder cells after rowspan/colspan 
> there might be some way to handle this pretty nicely with CSS. As 
> long as table is "missing" elements, there's no way CSS could handle 
>   this issue.

what about
grid#example cell[columns=4],
grid#example cell[rows=2]
{ display: none; }

This would hide all the cells whose columns attribute was exactly "4" or
whose rows attribute were exactly "2"

Received on Wednesday, 31 March 2004 11:09:52 UTC