drmixology
Programmer
Hello,
I have the following code. I would like the results to be displayed in 3 columns, rather than just 1:
<cfparam name="start" type="numeric" default="1">
<cfparam name="step" type="numeric" default="10">
<cfquery datasource="mydatabase" cachedwithin=".01" name="queryResults">
select *
from tblrecipes
order by recipe_name asc
</cfquery>
<cfif queryResults.recordcount gt 0>
<cfoutput>
<p>
<!--- if past start --->
<cfif (start-step-step) gt 1>
<a href="#cgi.SCRIPT_NAME#?start=1"><img src="images/Beginning_blue.png" alt="Beginning" width="31" height="21" align="absbottom"></a>
</cfif>
<cfif start gt 1>
<a href="#cgi.SCRIPT_NAME#?start=#start-step#"><img src="images/previous_blue.png" alt="Previous" align="absbottom"></a>
</cfif>
<strong>#start# - #iif(start + step gt queryResults.recordcount,queryResults.recordcount,start + step-1)# of #queryResults.recordcount# records</strong>
<!--- if still some not displayed --->
<cfif (start + step) lte queryResults.recordcount>
<a href="#cgi.SCRIPT_NAME#?start=#start+step#"><img src="images/next_blue.png" alt="Next" align="absbottom"></a>
</cfif>
<cfif (start+step+step) lte queryResults.recordcount>
<a href="#cgi.SCRIPT_NAME#?start=#queryResults.recordcount-step+1#"><img src="images/end_blue.png" alt="End" align="absbottom"></a>
</cfif>
</p>
</cfoutput>
</cfif>
<cfloop query="queryResults" startrow="#start#" endrow="#start + step-1#">
<table width="100%" border="1" bordercolor="#FFFFFF" cellspacing="0" cellpadding="2">
<tr>
<cfoutput>
<td width="33%">#queryResults.RECIPE_NAME#</td>
<cfif currentRow mod 3 eq 0>
</tr>
</cfif>
</cfoutput>
</table>
</cfloop>
It displays 10 results per page in one column.... How can I get the results on each page to display in a table with three columns?
Find cocktails at <a href=" Mixology</a>, the new http://www.drmixology.com"]mixology[/URL] community
I have the following code. I would like the results to be displayed in 3 columns, rather than just 1:
<cfparam name="start" type="numeric" default="1">
<cfparam name="step" type="numeric" default="10">
<cfquery datasource="mydatabase" cachedwithin=".01" name="queryResults">
select *
from tblrecipes
order by recipe_name asc
</cfquery>
<cfif queryResults.recordcount gt 0>
<cfoutput>
<p>
<!--- if past start --->
<cfif (start-step-step) gt 1>
<a href="#cgi.SCRIPT_NAME#?start=1"><img src="images/Beginning_blue.png" alt="Beginning" width="31" height="21" align="absbottom"></a>
</cfif>
<cfif start gt 1>
<a href="#cgi.SCRIPT_NAME#?start=#start-step#"><img src="images/previous_blue.png" alt="Previous" align="absbottom"></a>
</cfif>
<strong>#start# - #iif(start + step gt queryResults.recordcount,queryResults.recordcount,start + step-1)# of #queryResults.recordcount# records</strong>
<!--- if still some not displayed --->
<cfif (start + step) lte queryResults.recordcount>
<a href="#cgi.SCRIPT_NAME#?start=#start+step#"><img src="images/next_blue.png" alt="Next" align="absbottom"></a>
</cfif>
<cfif (start+step+step) lte queryResults.recordcount>
<a href="#cgi.SCRIPT_NAME#?start=#queryResults.recordcount-step+1#"><img src="images/end_blue.png" alt="End" align="absbottom"></a>
</cfif>
</p>
</cfoutput>
</cfif>
<cfloop query="queryResults" startrow="#start#" endrow="#start + step-1#">
<table width="100%" border="1" bordercolor="#FFFFFF" cellspacing="0" cellpadding="2">
<tr>
<cfoutput>
<td width="33%">#queryResults.RECIPE_NAME#</td>
<cfif currentRow mod 3 eq 0>
</tr>
</cfif>
</cfoutput>
</table>
</cfloop>
It displays 10 results per page in one column.... How can I get the results on each page to display in a table with three columns?
Find cocktails at <a href=" Mixology</a>, the new http://www.drmixology.com"]mixology[/URL] community