 | | Tip of The Day - Making collection data fill columns of a table |
The best way to do this is to use the .SubsetsOfMaxSize(Int) call on a collection. It breaks a collection up into collections of the given maximum size. An example:
set $Items=$New.Array(); $Items.Add(ELEMENT,"A"); $Items.Add(ELEMENT,"B"); $Items.Add(ELEMENT,"C"); $Items.Add(ELEMENT,"D");
$Items.Add(ELEMENT,"E"); $Items.Add(ELEMENT,"F"); $Items.Add(ELEMENT,"G"); $Items.Add(ELEMENT,"H");
$Items.Add(ELEMENT,"I"); $Items.Add(ELEMENT,"J"); $Items.Add(ELEMENT,"K");
<TABLE> forevery($Row,$Items.SubsetsOfMaxSize(4)) { <TR> forevery($Cell,$Row) { <TD>$Cell.ELEMENT; </TD> } </TR> } </TABLE>
|
|  |