Thanks Bobby. I'll try this later. After looking at all that code on easycfm.com(thank you for that link!!) seemed a bit over the top. I think if adobe would add attributes index or step to <cfloop query>, that would solve alot of that superfluous code.
Thanks all...If I can't get it, I'll be back :) -chris ><table> ><tr> > ><cfloop query="queryname"> > <td>#queryfield#</td> > <cfif currentrow mod 2 is 0 or currentrow is recordcount> > </tr> > <cfif currentrow neq recordcount><tr></cfif> > </cfif> ></cfloop> > ></table> > > >Basically it says this... >If this is the last row or a second column in a row, end this row but if the >row is being ended and this is NOT the last record, start a new row. > >Cheers > > >-----Original Message----- >From: Christopher Chin [mailto:[EMAIL PROTECTED] >Sent: Wednesday, May 16, 2007 2:55 PM >To: CF-Talk >Subject: cfloop output into columns - help > >Ok..this seemed easy at first..now I'm a bit ticked that I can't >figure this out. I'm sure you CF mavens out there have come across >this already; I'd appreciate your insight. :) > >I would like to output my query into a 2 column table; reading left to >right. >Example: >1 2 >3 4 >5 6 > >What I'm getting with my code is: >1 2 >2 3 >3 4 > >Here's my code: ><cfquery name="blah" datasource="employees"> > select * from employees where fname like 'John%' order by fname, >lname ></cfquery> ><cfoutput> ><table border="1"> ><cfset counter = 0> ><cfloop query="blah"> ><tr> > <td>#blah.fname# #blah.lname#</td> > <td>#blah.currentRow#</td> > <td>#blah.fname[currentRow+1]# #blah.lname[currentRow+1]#</td> > <td>#blah.currentRow+1#</td> ></tr> ><cfset counter = counter+1> ><cfset blah.currentrow = blah.currentRow+counter> ></cfloop> ></table> ></cfoutput> > >Anyone know how I can work this out to the output that I'd want? How >do I also not show the the 2nd <td> if it's not populated (an odd # >recordset)> > >Thanks in advance >Chris ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create Web Applications With ColdFusion MX7 & Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278356 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

