cfoutput formatting
I have an output block that looks like so, tr tdimg src=images/spacer.gif width=71 height=1 alt= border=0/td cfoutput query=getclients td valign=top width=26 class=copyinput class=copy name=theid type=checkbox value=#id#/td td valign=top width=200 class=copy#UCase(cusername)#br(#cpassword#)/td /cfoutput tdimg src=images/spacer.gif width=85 height=1 alt= border=0/td /tr After the cfoutput kicks out 4 records I need a new tr/tr to be created and then show the next 4 records in 4 more td's and so forth instead of getting one row with 120 cells in it. Maybe something with the cfoutputs on the out side of the tr and a loop inside or something. JLB ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: cfoutput formatting
Set a number (cfset count = 1) and increment it every time the query runs. Every time the number is equal to 4, set it back to 1 and output a /trtr Hope that makes sense, too lazy to write code! Ryan On 13/1/03 17:00, Jeremy Bunton [EMAIL PROTECTED] wrote: I have an output block that looks like so, tr tdimg src=images/spacer.gif width=71 height=1 alt= border=0/td cfoutput query=getclients td valign=top width=26 class=copyinput class=copy name=theid type=checkbox value=#id#/td td valign=top width=200 class=copy#UCase(cusername)#br(#cpassword#)/td /cfoutput tdimg src=images/spacer.gif width=85 height=1 alt= border=0/td /tr After the cfoutput kicks out 4 records I need a new tr/tr to be created and then show the next 4 records in 4 more td's and so forth instead of getting one row with 120 cells in it. Maybe something with the cfoutputs on the out side of the tr and a loop inside or something. JLB ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: cfoutput formatting
I use mod to do this... table tr cfoutput query=getReviews td #UCase(cusername)#br(#cpassword#) cfif (currentRow mod 4) eq 0 /tr tr /cfif /cfoutput /tr /table On 13/1/03 17:00, Jeremy Bunton [EMAIL PROTECTED] wrote: I have an output block that looks like so, tr tdimg src=images/spacer.gif width=71 height=1 alt= border=0/td cfoutput query=getclients td valign=top width=26 class=copyinput class=copy name=theid type=checkbox value=#id#/td td valign=top width=200 class=copy#UCase(cusername)#br(#cpassword#)/td /cfoutput tdimg src=images/spacer.gif width=85 height=1 alt= border=0/td /tr After the cfoutput kicks out 4 records I need a new tr/tr to be created and then show the next 4 records in 4 more td's and so forth instead of getting one row with 120 cells in it. Maybe something with the cfoutputs on the out side of the tr and a loop inside or something. JLB ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: cfoutput formatting
I use mod to do this... table tr cfoutput query=getReviews td #UCase(cusername)#br(#cpassword#) cfif (currentRow mod 4) eq 0 /tr tr /cfif /cfoutput /tr /table (I think you're missing the closing /td tag) One suggestion I'd add to the above is after you get out of the loop, you might need to pad the last row if the query doesn't return a multiple of 4 rows: cfif (currentRow mod 4) eq 0 /tr tr /cfif /cfoutput !--- This should get you the number of cells you need to add -- cfset padCells = 4 - getReview.RecordCount MOD 4 cfif padCells LT 4 cfloop from=1 to=#padCells# td nbsp; /td /cfloop /cfif /tr /table Scott Brady http://www.scottbrady.net/ ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: cfoutput formatting
cfif [queryname].currentrow mod 4 is 0 /tr tr /cfif Cutter Ryan Mitchell wrote: Set a number (cfset count = 1) and increment it every time the query runs. Every time the number is equal to 4, set it back to 1 and output a /trtr Hope that makes sense, too lazy to write code! Ryan On 13/1/03 17:00, Jeremy Bunton [EMAIL PROTECTED] wrote: I have an output block that looks like so, tr tdimg src=images/spacer.gif width=71 height=1 alt= border=0/td cfoutput query=getclients td valign=top width=26 class=copyinput class=copy name=theid type=checkbox value=#id#/td td valign=top width=200 class=copy#UCase(cusername)#br(#cpassword#)/td /cfoutput tdimg src=images/spacer.gif width=85 height=1 alt= border=0/td /tr After the cfoutput kicks out 4 records I need a new tr/tr to be created and then show the next 4 records in 4 more td's and so forth instead of getting one row with 120 cells in it. Maybe something with the cfoutputs on the out side of the tr and a loop inside or something. JLB ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: cfoutput formatting
Ahh yes many thanks that seems to work well. JLB -Original Message- From: Scott Brady [mailto:[EMAIL PROTECTED]] Sent: Monday, January 13, 2003 1:06 PM To: CF-Talk Subject: Re: cfoutput formatting I use mod to do this... table tr cfoutput query=getReviews td #UCase(cusername)#br(#cpassword#) cfif (currentRow mod 4) eq 0 /tr tr /cfif /cfoutput /tr /table (I think you're missing the closing /td tag) One suggestion I'd add to the above is after you get out of the loop, you might need to pad the last row if the query doesn't return a multiple of 4 rows: cfif (currentRow mod 4) eq 0 /tr tr /cfif /cfoutput !--- This should get you the number of cells you need to add -- cfset padCells = 4 - getReview.RecordCount MOD 4 cfif padCells LT 4 cfloop from=1 to=#padCells# td nbsp; /td /cfloop /cfif /tr /table Scott Brady http://www.scottbrady.net/ ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4