Quick pseudo-code that I've used in the past:
Find the column split point -- ceiling ( recordcount/2 )
Loop
Output item n in col 1
If item n+split point exists
Output item n + split point in col 2
End if
End loop
You may have to tweak slightly, but that should give you 2 columns
where column 2 is the second half of your query results. The
ceiling() function should serve to make column 1 larger than column 2
if the recordcount is an odd number.
Hope that makes sense and gets you a little closer to what you're looking for.
On 4/7/06, Coldfusion <[EMAIL PROTECTED]> wrote:
> <CFOUTPUT QUERY="myQuery ">
> <CFIF myQuery.recordcount MOD 2>
> <!--- Display all elements for 2 column --->
> <CFELSE>
> <!--- Display all elements for 1 column --->
> </CFIF>
> </CFOUTPUT>
>
>
> -----Original Message-----
> From: Johnny Le [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 06, 2006 10:56 PM
> To: CF-Talk
> Subject: How to format the print view like a phone book?
>
> Hi,
>
> I am trying to format a 2-column page to make a pdf print version. The
> problem is that if I use a 2-column table, then first record would display
> in the first column and the second record would display in the second
> column. Is there a way to display it so it would run to the end of the page
> on the first column first and then continue on the second column and then
> continue on the next page? I am using CFMX 7. Is there a custom or
> something to make this easier?
>
> Johnny
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237162
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54