W3C home > Mailing lists > Public > www-style@w3.org > July 2005

Re: rows with display:table

From: Christoph Päper <christoph.paeper@tu-clausthal.de>
Date: Fri, 29 Jul 2005 12:22:56 +0200
Message-ID: <42EA0380.4060202@tu-clausthal.de>
To: www-style@w3.org
CC: Manuel Strehl <manuel.strehl@stud.uni-regensburg.de>

Manuel Strehl:
> Concerning display:table-...: I've got a <ul> with, say, 20 <li>s
> and I want it to be displayed as a 4 x 5 table.
> 
> ul :nth-child( 4n ) :before { display:table-row }
> 
> would that work (...)? 

No. Further assuming

   ul {display: table}
   li {display: table-cell}

that would yield something like this:

   ul table
     anonymous table-row
        li table-cell
        li table-cell
        li table-cell
        li table-cell
          anonymous table
            ::before table-row
        ... (five times)


You might get close to what you want with

   ul {width: 100%;}
   li {width: 25%; float: left; display: block; margin: 0; padding: 0;}
Received on Friday, 29 July 2005 10:23:01 GMT

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