Well here's one way to do that...

<!--- make some lists --->
<cfset cat1 = ValueList(query.category1)>
<cfset cat2 = ValueList(query.category2)>
<cfset cat3 = ValueList(query.category3)>

<!--- find out how long each list is --->
<cfset cat1len = ListLen(cat1)>
<cfset cat2len = ListLen(cat2)>
<cfset cat3len = ListLen(cat3)>

<!--- find the longest list --->
<cfset maxlen = IIF(cat1 GT cat2, cat1, cat2)>
<cfset maxlen = IIF(cat3 GT maxlen, cat3, maxlen)>

<table>
<cfloop from="1" to="#maxlen#" index="i">
        <tr>
                <cfoutput>
                <td>#IIF(i GT cat1len, DE("&nbsp;"), ListGetAt(cat1, i))#</td>
                <td>#IIF(i GT cat2len, DE("&nbsp;"), ListGetAt(cat2, i))#</td>
                <td>#IIF(i GT cat3len, DE("&nbsp;"), ListGetAt(cat3, i))#</td>
                </cfoutput>
        </tr>
</cfloop>

I haven't tested that, so there could be a bug or two, but logic seams to
make sense.

______________________________________________
Pete Freitag ([EMAIL PROTECTED])
CFDEV.COM / NETDesign Inc.
ColdFusion Developer Resources
http://www.cfdev.com/



-----Original Message-----
From: Richard Colman [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 16, 2000 11:24 PM
To: CF-Talk
Subject: RE: outputting data in a matrix


What is a PIVOT REQUEST?

-----Original Message-----
From: Gena [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 16, 2000 3:48 PM
To: CF-Talk
Subject: Re: outputting data in a matrix


Play with pivot requests. It should help.


Gennadi


----- Original Message -----
From: "Richard Colman" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, October 17, 2000 8:28 AM
Subject: outputting data in a matrix


> Can someone suggest how to do this:
>
> category1  category2    category3
> --------   ----------   -------
> item 1      item 1       item 1
> item 2      item 2       item 2
> item 3      item 3
>             item 4
>
>
> where the data table looks like:
>
> category, item, etc.
>
> there will be an unequal number of items per category.
>
> ideas for an approach appreciated. Thank you.
>
> Richard Colman
>
> --------------------------------------------------------------------------
----
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>

----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to