Implementing a multi-column list

Hi-

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

Any suggestions are greatly appreciated!
Cindy Hunt

Received on Tuesday, 3 December 2002 11:26:21 UTC