<cfset colsperrow = 3> <!--- columns you want per row ---> <cfquery name="getimages" datasource="datasourcename"> select * from tbl_imagegallery </cfquery>
<table align="center" border="0" cellspacing="0" cellpadding="5"> <tr> <cfoutput query="getimages"> <td><img src="#getimages.image#"></td> <!--- if the current rows remainder after dividing by the number of columns you want PER row is 0 end the row and start a new---> <cfif currentrow MOD colsperrow IS 0> </tr><tr> </cfif> </cfoutput> </tr> </table> ----- Original Message ----- From: "Mike Brunt" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Monday, September 02, 2002 3:19 PM Subject: RE: Advice? > John, I hope I am understanding you correctly, anyhow let's see if this > helps using the example you sight: - > > <!--- Run query. ---> > <CFQUERY name="GetRecords" datasource="CNET"> > SELECT CustomerName, company, market > FROM CustomerRecords > </CFQUERY> > > <!--- Write results to a table. ---> > <TABLE> > <CFOUTPUT> > <TR> > <TD>#GetRecords.CustomerName#</TD> > <TD>#GetRecords.company#</TD> > <TD>#GetRecords.market#</TD> > </TR> > </CFOUTPUT> > </TABLE> > > This will give you a 3 column output into an html table. > > You could also do this: - > > <TABLE> > <cfoutput query="GetRecords"> > <TR> > <TD>#CustomerName#</TD> > <TD>#company#</TD> > <TD>#market#</TD> > </TR> > </CFOUTPUT> > </TABLE> > > Hth > Kind Regards - Mike Brunt, CTO > Webapper > http://www.webapper.com > Downey CA Office > 562.243.6255 > AIM - webappermb > > "Webapper - Making the NET work" > > > -----Original Message----- > From: John Munyan [mailto:[EMAIL PROTECTED]] > Sent: Monday, September 02, 2002 11:58 AM > To: CF-Talk > Subject: Advice? > > > Hi, I am new to using coldfusion and programming in general. I have spent > the last two days (no joke) trying to figure out how to take the output of a > cfquery and split it up into multiple columns. I have found a couple > examples on the web for doing this and have tried diligently to adapt them > to my situation. I would appreciate it if someone could give me a pointer > about where I am going wrong with what I am doing if you would be so kind. > I really seem to be at my wits end and feel I am missing something > fundamental. > > I have been trying to amend the below example to my code. > http://builder.cnet.com/webbuilding/pages/Programming/ScriptMagic/ss01k.html > > I have positioned the below with the other cfset commands. > <!--- Specify number of columns. ---> > <CFSET NumberOfColumns = 2> > > > Below is the loop I can't figure out. > > <!-- InstanceBeginEditable name="Main Area Content" --> > <table border="0" cellpadding="0" cellspacing="2"> > <tr> </tr> > <cfoutput query="Recordset1" > startrow="#StartRow_Recordset1#" maxrows="#MaxRows_Recordset1#"> > <CFIF (CurrentRow MOD NumberOfColumns) IS 1> > </TR><TR> > </CFIF> > <tr> > <td> </td> > <td><a href="#Recordset1.FullURL#"><img > src="#Recordset1.ThumbnailURL#" border="0"></a></td> > <td> </td> > </tr> > </cfoutput> > </table> > <p> </p> > <p> </p> > <!-- InstanceEndEditable --> </td> > > > Whatever help or advice you could give would be greatly apprecited. > > Thanks, > > John > > ______________________________________________________________________ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

