W3C home > Mailing lists > Public > www-xsl-fo@w3.org > December 2002

Re: Implementing a multi-column list

From: Oleg Tkachenko <olegt@multiconn.com>
Date: Tue, 03 Dec 2002 18:46:22 +0200
Message-ID: <3DECDFDE.2050706@multiconn.com>
To: Cindy Hunt <Cindy.Hunt@sas.com>
CC: www-xsl-fo@w3.org

Cindy Hunt wrote:

> I wanted to see if anyone has done something similar to this and offer implementation suggestions. In our DTD, we have a list type that allows the user to specify the number of columns that they would like the list to format in via an attribute on the list element. The list then contains a series of 2 or more items that are just PCDATA.
> 
> Basically, I need to count the number of items in the list and divide it by the number of columns they specified. The items should then fill each column from top to bottom and then any remainders would be placed in the last column.
> 
> For example if the list contained 5 items and the user specified they wanted 3 columns it would look like so:
> 
> item 1	item 3	item 5    
> item 2	item 4
> 
> Or if the list contained 5 items and the user specified they wanted 2 columns it would look like so:
> 
> item 1	item 4
> item 2	item 5
> item 3

Have you considered native declarative xsl-fo solution? Just declare how much 
columns you want on a region-body and let your favorite formatter to format 
your items appropriatively.

<fo:region-body column-count="{$user-defined-number-of-columns}" 
column-gap="10pt"/>

See
1. spec:
http://www.w3.org/TR/xsl/slice6.html#fo_region-body
2. example:
"Multi-Column Regions" example at http://www.renderx.com/testcases.html.

-- 
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel
Received on Tuesday, 3 December 2002 11:46:47 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:06:10 GMT