|
|
Server Time: Thursday May 22 2008 01:57 PM |
|
Your Time: |
<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
Best Practices
Functions
Other
Working w/Data
 |
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
· Website Monitor
· Auto Event Emailer
· IP checker
· Count Down
|
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
|
|
|
|
|
|
|
|