this should help....remember a query can be treated as an array, so
you'll be able to substitute your code into this without too many
problems.

<!--- setup some data --->
<cfset a=arraynew(1) />
<cfloop index="i" from="1" to="17">
        <cfset a[i] = i />
</cfloop>

<!--- determine bounds --->
<cfset C_NUMBER_OF_ROWS = "3" />
<cfset recordset_len = arraylen(a) />
<cfset row_count = ceiling(recordset_len / C_NUMBER_OF_ROWS)>

<!--- output --->
<table>
<cfloop index="i" from="1" to="#row_count#">
        <tr>
        <cfloop index="j" from="1" to="#C_NUMBER_OF_ROWS#">
                <cfset array_index = ((j-1)*row_count)+i>
                <cfif array_index lte recordset_len>
                <td><cfoutput>#a[array_index]#</cfoutput><td>
                <cfelse>
                <td>&nbsp;</td>
                </cfif>
        </cfloop>
        </tr>
</cfloop>
</table>

On Apr 5, 1:03 pm, "Taco Fleur" <[EMAIL PROTECTED]> wrote:
> fixed number of columns, i.e. 3
>
> On 4/5/07, Dale Fraser <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
>
>
> >  So are you saying a fixed number of rows 6
>
> > Or a fixed number of columns 3?
>
> > Regards
>
> > Dale Fraser
>
> >http://dale.fraser.id.au/blog
>
> >  ------------------------------
>
> > *From:* [email protected] [mailto:[EMAIL PROTECTED] *On
> > Behalf Of *Taco Fleur
> > *Sent:* Thursday, 5 April 2007 2:33 PM
> > *To:* [email protected]
> > *Subject:* [cfaussie] outputting recordset
>
> > Hi all,
>
> > I have a problem I can't seem to get my head around, any help is
> > appreciated.
>
> > I need to output a recordset in a table, infinite rows, and maximum 3
> > columns in width.
>
> > Output need to be as following though;
>
> > 1 - 7 - 13
>
> > 2 - 8 - 14
>
> > 3 - 9 - 15
>
> > 4 - 10 - []
>
> > 5 - 11 - []
>
> > 6 - 12 - []
>
> > --
> > Taco Fleur -http://www.pacificfox.com.au
> > Web Design, Web development, Graphic Design and Complete Internet
> > Solutions
> > an industry leader with commercial IT experience since 1994 ...
>
> --
> Taco Fleur -http://www.pacificfox.com.au
> Web Design, Web development, Graphic Design and Complete Internet Solutions
> an industry leader with commercial IT experience since 1994 ...- Hide quoted 
> text -
>
> - Show quoted text -


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to