Answering my own post...
Here is what seems to be doing what I need:

<@ASSIGN NAME="gGenreArray" SCOPE="local" VALUE="@@resultSet">
<@ASSIGN NAME="gQtyGenreArray" SCOPE="local" VALUE="<@NUMROWS
ARRAY=local$gGenreArray>">
<@ASSIGN SCOPE="local" NAME="gColCount" VALUE="4">
<@ASSIGN SCOPE="local" NAME="gStep" VALUE="<@CALC
EXPR='@@local$gQtyGenreArray/@@local$gColCount'>">

<TABLE>
<@FOR START=1 STEP='1' STOP='@@local$gStep'>
<TR>
<TD>@@local$gGenreArray[<@CURROW>,2]</TD>
<TD>@@local$gGenreArray[<@CALC EXPR="<@CURROW>+@@local$gColCount">,2]</TD>
<TD>@@local$gGenreArray[<@CALC
EXPR="<@CURROW>+(@@local$gColCount*2)">,2]</TD>
<TD>@@local$gGenreArray[<@CALC
EXPR="<@CURROW>+(@@local$gColCount*3)">,2]</TD>
</TR>
</@FOR>
</TABLE>


On 5/13/02 3:06 PM, "Tom Carr" <[EMAIL PROTECTED]> wrote:

> Hmmm, I do not see how transpose will accomplish this.
> 
> I may have misled you a bit. The data is not arranged in the array like I
> listed it below, The data is coming out in an array with 3 columns (primary
> key, name, attribute_id). I am displaying the name in the results html. The
> attribute_id is being used for the form submit value.
> 
> OK, that being clarified, if I transpose the array, I cannot specify how
> many columns I want.
> 
> The only way I can see to do this is to use a for loop and step through the
> array by the number of columns, starting at a different start point for each
> item.
> 
> Since a table has to be displayed like this:
> <TR><TD>1</TD><TD>6</TD><TD>11</TD></TR>
> I need to step through by 5--because 14(<@NUMROWS>) divided by 3(desired
> number of columns) rounds up to 5.
> 
> So something like this: (thinking out loud here. Does this make sense?
> 
> <@ASSIGN SCOPE="local" NAME="gRowCount" VALUE="<@NUMROWS ARRAY='myArray'>">
> <@ASSIGN SCOPE="local" NAME="gColCount" VALUE="3">
> <@ASSIGN SCOPE="local" NAME="gStep" VALUE="<@CALC
> EXPR='@@local$gRowCount/@@local$gColCount'>">
> 
> ** side question **
> How do I round the above calc to the next greater integer?
> 
> <TABLE>
> <@FOR START=1 STEP='@@local$gColCount' STOP='@@local$gRowCount'>
> <TR>
> <@FOR START='<@CURROW>' STEP='@@local$gStep' STOP='@@local$gRowCount'>
> <TD>@@local$myArray[<@CURROW>,2]</TD>
> </FOR>
> </TR>
> </FOR>
> 
> On 5/13/02 2:43 PM, "Thijs Kroesbergen" <[EMAIL PROTECTED]> wrote:
> 
>> I think you're looking for
>> 
>> <@TRANSPOSE>
>> Exchanges row and column specifications for values in an array; for example,
>> the value in the third row, first column is transposed to the first row,
>> third column. The ARRAY attribute specifies the array to transpose. The
>> optional SCOPE attribute specifies the scope.
>> 
>> -thijs
>> 
>>> -----Original Message-----
>>> From: [EMAIL PROTECTED]
>>> [mailto:[EMAIL PROTECTED]]On Behalf Of Tom Carr
>>> Sent: Monday, May 13, 2002 12:18 PM
>>> To: Multiple recipients of list witango-talk
>>> Subject: Witango-Talk: Arranging a table vertically, not horizontally
>>> 
>>> 
>>> I am wanting to take the data coming out of a search and
>>> dynamically put the
>>> data in an html table vertically rather than horizontally like this:
>>> 
>>> 1     6     11
>>> 2     7     12
>>> 3     8     13
>>> 4     9     14
>>> 5     10
>>> 
>>> 
>>> Rather than this:
>>> 1     2     3
>>> 4     5     6
>>> 7     8     9
>>> 10    11    12
>>> 13    14
>>> 
>>> Anyone got a snippet to get me started here?
>>> I used to use the <MULTICOL> tag, but that is long since unsupported...
>>> Trying to recreate that functionality wiTango.
>>> 
>>> Thx.
>>> 
>>> 
>>> --> [groundZERX]
>>> --> [t:o:m:c:a:r:r]
>>> --> [[EMAIL PROTECTED]]
>>> --> [847:757:4188]
>>> 
>>> 
>>> ________________________________________________________________________
>>> TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
>>>                 with unsubscribe witango-talk in the message body
>>> 
>>> 
>> 
>> 
>> ________________________________________________________________________
>> TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
>>               with unsubscribe witango-talk in the message body
> 
> 
> --> [groundZER�]
> --> [t:o:m:c:a:r:r]
> --> [[EMAIL PROTECTED]]
> --> [847:757:4188]
> 
> 
> ________________________________________________________________________
> TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
>               with unsubscribe witango-talk in the message body


--> [groundZER�]
--> [t:o:m:c:a:r:r]
--> [[EMAIL PROTECTED]]
--> [847:757:4188]


________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
                with unsubscribe witango-talk in the message body

Reply via email to