ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 19th, 2005, 08:12 AM
Moo Ouwan Moo Ouwan is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 18 Moo Ouwan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 37 m 53 sec
Reputation Power: 0
Displaying Recordsets in multiple rows and columns in CF

Hi there,

I'm trying to display ecommerce product photos horizontally across a page with multiple rows. To be more precise, I'd like to display my products in a 5 by 5 table displaying 25 database rows per page. Then, if there are more than 25 database rows output, the subsequent results would then flow onto subsequent pages.

Is there a quick way to achieve this? I cannot find anything on the net that answers this question.

Would much appreciate any help that anyone can offer.

Regards
Moo

Reply With Quote
  #2  
Old September 19th, 2005, 08:58 AM
kiteless kiteless is online now
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,692 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 43 m 41 sec
Reputation Power: 53
You're really asking two questions. The easiest way to output a 5 column table is to use the MOD operator. Mod returns the remainder of the division of two numbers so you can use that to test what column is being rendered. Here's one for three columns:

<cfoutput>
<table border="1">
<cfloop index="i" from="1" to="12">
<cfif i mod 3 eq 1>
<tr>
</cfif>
<td>#i# - #i mod 3#</td>
<cfif i mod 3 eq 0>
</tr>
</cfif>
</cfloop>
</table>
</cfoutput>

The other question you ask is about paged recordsets. There are many ways to do this, a Google search for "ColdFusion next n records" showed a bunch, including this.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old September 19th, 2005, 12:10 PM
Moo Ouwan Moo Ouwan is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 18 Moo Ouwan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 37 m 53 sec
Reputation Power: 0
Thanks very much for your help. I'll give this a go.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Displaying Recordsets in multiple rows and columns in CF


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT