Server Time:
Thursday May 22 2008 01:57 PM  
Your Time:
  
HostMySite.Com is sponsoring this tutorial, please visit their site today!
This tutorial is sponsored by HostMySite.Com - ColdFusion Hosting

Column View Output
by: Rhino
Email this tutorial to a friend Display Printer Friendly Format
[Download in PDF Format] [Download in FlashPaper Format]

<cfquery name="listall"
             datasource="[yourDSN]">

         select * from [yourdatabase]

</cfquery>

<html>
<head>
<title>List All</title>
</head>

<body>

<center>
<Table border="1" width="100%">

 

<CFLOOP INDEX="current_row"
              FROM=
"1"
              TO=
"#ceiling(listall.recordcount/3)#"
              STEP=
"1">
<tr>
<cfparam name="startrow" default="1">
<CFOUTPUT
             QUERY=
"listall"
             STARTROW=
"#startrow#"
             MAXROWS=
"3">

<td width ="33%">#Firstname# #lastname#<br>#address1#<br>#address2#<br>#state# #zip#<P></td>
</CFOUTPUT>

<cfset startrow = #startrow# + 3>
</tr>

</center>
</cfloop>
</table>

</body>
</html>


Date added: Wed. February 25, 2004
Posted by: Rhino | Views: 8085 | Tested Platforms: CFMX | Difficulty: Intermediate
Categories Listed: Best Practices Functions Other Working w/Data

HostMySite.Com is sponsoring this tutorial, please visit their site today!
This tutorial is sponsored by HostMySite.Com - ColdFusion Hosting

This author's other tutorials:
Form with 2 Submit Buttons
An easy way to have a form with 2 or more submit buttons where each one does a different thing. One can count a rows in a DB, then next can actually submit the query. Possibilities are limitless. - Date added: Mon. October 9, 2006
Enter-Update same form
I hate creating duplicate forms where one is for entry and an identical one is for udpating. This code lets you use one form for both purposes. - Date added: Wed. April 7, 2004
Use checkboxes on update pages
Do you have an update page and want to use checkboxes on the page? This tutorial will go over the two steps needed. - Date added: Wed. March 31, 2004
Form processor with individual link email
This tutorial shows how to process a form and generate a random string that is put on the end of a link. When the user clicks the link it goes to their personal page. - Date added: Wed. March 31, 2004
User Authenication - ADMIN area
This script provides a simple admin area for the login script written by Pablon on this site. You can list, add, change pass, and delete users. - Date added: Mon. March 29, 2004

Additional Tutorials:
· Website Monitor

· Auto Event Emailer

· IP checker

· Count Down
Please rate this tutorial:
5 Stars 4 Stars 3 Stars 2 Stars 1 Stars
Comments on this tutorial
Read previous comments on this particular tutorial
Simpler way to do it:
Here's where I used one extra line with the cfoutput query type:

<table width="100%" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>

<cfoutput query="listall">
<td width="33%" valign="top">
#Firstname# #lastname#<br>#address1#<br>#address2#<br>#state# #zip#<P>
</td>
<cfif (CurrentRow MOD 3) eq 0 and CurrentRow lt RecordCount></tr><tr></cfif>
</cfoutput>

</tr>
</table>
Posted by: Clint Willard
Posted on: 04/15/2005 08:52 AM
Post a new comment on this tutorial
post a new comment on this particular tutorial
Your Name:
Your Email:
Comment Title:
Comments:
Key Phrase:
 
Skyscrapper Banner Advertisement
Daily Razor - ColdFusion Hosting

You are 1 of 616 active sessions! | Privacy | Company
Copyright © 2002 EasyCFM.Com, LLC. (Easy ColdFusion Tutorials) All Rights Reserved (Server: www0001)
All other trademarks and copyrights are the property of their respective holders.
ColdFusion Hosting ColdFusion Hosting
ADD TO:
Blink
Del.icio.us
Digg
Furl
Google
Simpy
Spurl
Y! MyWeb