Well David,
that's the way... :-)
Thanks a lot.
Patric
----- Original Message -----
From: "David Gassner" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 29, 2000 2:25 AM
Subject: RE: Another Query to Table
| Patric, you'll need to use the index array method of getting to query
data.
| Here's some code which does what you want, assuming a query named "q" and
a
| field called "fieldvalue":
|
| <!--- If number of items isn't divisible by three,
| add one row --->
| <cfset numRows = q.recordcount / 3>
| <cfif (numRows mod 3)>
| <cfset numRows = int(numRows) + 1>
| </cfif>
|
| <table cellpadding="5" cellspacing="0">
| <cfloop from=1 to="#numRows#" index="currentRow">
|
| <!--- Start the row with alternating colors --->
| <cfoutput>
| <tr bgcolor=#iif(currentRow mod 2,
| de("silver"),
| de("white"))#>
| </cfoutput>
|
| <cfloop from="1" to="3" index="cellNumber">
| <cfset dataIndex = (numRows * (cellNumber-1)) + currentRow>
| <td>
| <cfif dataIndex lte q.recordcount>
| <cfoutput>#dataindex#-#q.fieldvalue[dataIndex]#</cfoutput>
| </cfif>
| </td>
| </cfloop>
| </tr>
|
| </cfloop>
| </table>
|
| David Gassner
| Vintage Business Applications
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
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.