<!--- This tutorial shows how to display queried data in a determined amount of columns instead of the default one column --->

<!--- Grabbing Data Here --->
<cfquery name="getdata" datasource="#application.dsn#">
    select distinct corpname
    from rfp_tracking
    order by rfp_corpname
</cfquery>
<!--- Create your table here --->
<table align="center" width="90%" rules="none">
    <tr>
        <Td>
List of Companies</TD>
    </tr>
    <!--- Loop Through Your Data --->
    <cfloop query="getdata">

        <!--- This basically gets 6 records, displays it and then creates a new row. You can substitue any number for the 6 --->
        <!--- It loops through until record count divided by record count equals one --->
        <cfif getdata.currentrow mod 6 EQ 1>
            <tr>
        </cfif>
        <!--- and then display the data here --->
            <td><cfoutput>#getdata.corpname#</cfoutput></td>
    </cfloop>
</table>

About This Tutorial
Author: Jennifer Davis
Skill Level: Beginner 
 
 
 
Platforms Tested: CF5
Total Views: 29,664
Submission Date: January 14, 2005
Last Update Date: June 05, 2009
All Tutorials By This Autor: 2
Discuss This Tutorial
  • Hey there, glad to have found this tid bit. But I thought I would let you know you forgot to add a closing tag after the closing . Here is the same code pretty much without a database output: Multi-Column output

    #i#

Advertisement

Sponsored By...
Powered By...