W3C home > Mailing lists > Public > www-style@w3.org > January 2009

Re: [CSS21] Concern about anonymous table objects and whitespace

From: Bert Bos <bert@w3.org>
Date: Fri, 23 Jan 2009 20:40:37 +0100
To: www-style@w3.org
Message-Id: <200901232040.37648.bert@w3.org>

On Thursday 22 January 2009 21:18, Tab Atkins Jr. wrote:
> On Thu, Jan 22, 2009 at 1:01 PM, Boris Zbarsky <bzbarsky@mit.edu> 
wrote:
> > Thinking about your use case some more, what if we allowed
> > inference of table rows between tables and cells, say, but didn't
> > show any non-table-related anything that's a direct child of a
> > table, table-row-group, or table-row?  Would that cover enough of
> > the use cases? It would certainly cover both of yours.
> >
> > As far as that goes, we could also require that any table-row,
> > table-row-group, or table-cell needs to have a table somewhere
> > around it. That would still cover your use cases, but be
> > significantly simpler.
>
> After thinking on it a bit more (and a quick off-list discussion with
> Boris), I think this is exactly what we should do.  Not only is it
> simple, but afaict it matches current <table> behavior perfectly.

The counterexample is this: I want to render the following three lists 
(days, persons and places) as a single 4x3 table.

    <report>
      <title>Week 13</title>
      <days>
        <item>Monday</item>
        <item>Tuesday</item>
        <item>Wednesday</item>
        <item>Thursday</item>
      </days>
      <persons>
        <item>Joe</item>
        <item>Ann</item>
        <item>Sue</item>
        <item>Ray</item>
      </persons>
      <places>
        <item>Oslo</item>
        <item>Rome</item>
        <item>Lisbon</item>
        <item>Sofia</item>
      </places>
    </report>

I can do that with a style sheet like this:

    title {display: block; font-size: large; margin: 1em 0}
    days, persons, places {display: table-row}
    item {display: table-cell}

There is no element corresponding to the table box.

Unfortunately, this doesn't allow me to use the collapsing borders 
model, making the use of borders a bit more difficult. But with some 
clever selectors I can usually still get the borders where I want them.

(We once also considered a "transpose" or "column-major" feature to swap 
columns and rows, but that hasn't been a high priority.)



Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos                               W3C/ERCIM
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France
Received on Friday, 23 January 2009 19:41:15 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:15 GMT