<table>
<tr>
<cfloop query="myquery">

<td>#record#</td>
<cfif currentrow MOD 4 is 0 or currentrow is recorcount>
<!--- if this is the 4th colum or the last record end the row --->
</tr>
<!---if this is the 4th column and NOT the last record, start a new row --->
<cfif currentrow MOD 4 is 0 AND currentrow NEQ recordcount><tr>
</cfif>
</cfloop>

If you had 8 records, youd get just what you posted as an example
If you had say 7 recrods, youd get

<table>
<tr><td>record1</td><td>record2</td><td>record3</td><td>record4</td></tr>
<tr><td>record5</td><td>record6</td><td>record7</td></tr>
</table>

-----Original Message-----
From: Bill Burdin [mailto:[EMAIL PROTECTED] 
Sent: Saturday, November 13, 2004 12:02 AM
To: CF-Talk
Subject: formatting output into a HTML table

Greetings,
I would like to format query results in a table For example I may have 8
records returned by a query and would like to lay them out like this:

<table>
<tr><td>record1</td><td>record2</td><td>record3</td><td>record4</td></tr>
<tr><td>record5</td><td>record6</td><td>record7</td><td>record8</td></tr>
</table>

Any tips on how to acheive this most welcome.
Thanks
Bill



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:184215
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to