Ooops, the last snippet is for horizontal, this is for vertical. Notice the
differences. It is very important to start the col loop at 0. For the
TableRow calc to work correctly.
<@! first figure the number of rows>
<@assign local$numTableRows
<@calc "ceil(<@numrows array=local$tableArray>/@@local$numCols)">>
<table>
<@! Create a counter to keep track of the Row number>
<@assign local$rowCounter 1>
<@! Loop for Rows>
<@for start=1 step=1 stop=@@local$numTableRows>
<tr>
<@! now loop for the cols>
<@for start=0 step=1 stop=<@calc "@@local$numCols - 1">>
<td>
<@! Use if empty so empty fields show correctly>
<@! Make calc of row for Table Array>
<@assign local$tableRow
<@calc "@@local$rowCounter + (@@local$numTableRows * <@currow>)">>
<@ifempty "<@var local$tableArray[@@local$tableRow,1]>">
<@else>
<@var local$tableArray[@@local$rowCounter,1]>
</@if>
</td>
<@! End of Col loop>
</@for>
</tr>
<@! Increment row Counter before reiterating>
<@assign local$rowCounter
<@calc"@@local$rowCounter + 1">>
</@for>
</table>
--
Robert Garcia
BigHead Technology
21053 Devonshire Suite 206
Chatsworth, Ca 91311
Phone 818.773.8162
Fax 818.773.8164
http://www.bighead.net/
[EMAIL PROTECTED]
> From: Robert Garcia <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Tue, 14 May 2002 01:15:36 -0700
> To: Multiple recipients of list witango-talk <[EMAIL PROTECTED]>
> Subject: Re: Witango-Talk: Arranging a table vertically, not horizontally
>
> <@! first figure the number of rows>
> <@assign local$numTableRows
> <@calc "ceil(<@numrows array=local$tableArray>/@@local$numCols)">>
>
> <table>
>
> <@! Create a counter to keep track of the Row number>
> <@assign local$rowCounter 1>
>
> <@! Loop for Rows>
> <@for start=1 step=1 stop=@@local$numTableRows>
>
> <tr>
> <@! now loop for the cols>
> <@for start=1 step=1 stop=@@local$numCols>
>
> <td>
> <@! Use if empty so empty fields show correctly>
> <@ifempty "<@var local$tableArray[@@local$rowCounter,1]>">
>
> <@else>
> <@var local$tableArray[@@local$rowCounter,1]>
> </@if>
>
> </td>
> <@! End of Col loop>
> <@! Increment row Counter before reiterating>
>
> <@assign local$rowCounter
> <@calc"@@local$rowCounter + 1">>
> </@for>
>
> </tr>
> </@for>
> </table>
________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
with unsubscribe witango-talk in the message body