[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Filling table cells with <item>s

Subject: Filling table cells with <item>s
From: "Steve Renshaw" <renshaw_steve@xxxxxxxxxxx>
Date: Thu, 04 Apr 2002 10:28:15 +0000
filling table
I have to format n <item>s into a set of table cells:

<root>
<item>item01</item>
<item>item02</item>
...
<item>item14</item>
<item>item15</item>
</root>

If each table must have nrows and ncols, then a total of

ntables=ceiling(n/(nrows*ncols))

tables are necessary to exhaust all of the <item>s with the
last table possibly having some empty cells. For example
if n=15, nrows=3 and ncols=2, ntable=3 and the three tables
would be arranged one after the other as follows:

  +------+------+
  |item01|item02|
  +------+------+
  |item03|item04|
  +------+------+
  |item05|item06|
  +------+------+

  +------+------+
  |item07|item08|
  +------+------+
  |item09|item10|
  +------+------+
  |item11|item12|
  +------+------+

  +------+------+
  |item13|item14|
  +------+------+
  |item15|      |
  +------+------+
  |      |      |
  +------+------+

Also, I would like the option to fill the tables up by
rows (as shown above) or by columns:

  +------+------+
  |item01|item04|
  +------+------+
  |item02|item05|
  +------+------+
  |item03|item06|
  +------+------+

How would you go about implementing this in XSLT given
parameters nrows, ncols, by={"cols","rows"}? I am having
some trouble determining what my "outer" loop is since there
is the possibility of some empty cells (I can't just process
each <item>). Thx in advance.


_________________________________________________________________
Join the world?s largest e-mail service with MSN Hotmail. http://www.hotmail.com



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.