[thelist] Cold Fusion Column Formatting

rudy r937 at interlog.com
Tue Jul 10 16:15:21 CDT 2001


> Thanks for the suggestions guys - an array would do the trick nicely!!

yeah, thanks joshua, i went back and simplified my code, rather than read
all the result records into an array, i just treat the result set as an
array (doh!)

here ya go, robin --

   <cfquery name="bkmks" datasource="mydatabase">
     select bkmk_title, bkmk_url
       from bkmks
    order by bkmk_title
   </cfquery>

   <cfset myrows= bkmks.RecordCount>
   <cfset third = Ceiling(myrows/3)>

   <table border="1" cellpadding="2" cellspacing="0">
   <cfoutput>
   <cfloop index="i" FROM="1" TO="#third#">
   <cfset j = i + third>
   <cfset k = j + third>
   <tr>
   <td><a href="#bkmks["bkmk_url"][i]#"
               >#bkmks["bkmk_title"][i]#</a></td>
   <td><a href="#bkmks["bkmk_url"][j]#"
               >#bkmks["bkmk_title"][j]#</a></td>
   <td><cfif k GT myrows>&nbsp;
       <cfelse><a href="#bkmks["bkmk_url"][k]#"
              >#bkmks["bkmk_title"][k]#</a></cfif></td>
   </tr>
   </cfloop>
   </cfoutput>
   </table>


rudy





More information about the thelist mailing list