Say your list is in a variable called "some_list". The following code will
display the list elements in a three column HTML table.
<CFOUTPUT>
<TABLE>
<CFSET col_counter = 1>
<CFLOOP INDEX="loop_counter" FROM="1" TO="#ListLen(some_list)#">
<CFIF col_counter eq 1>
<TR>
</CFIF>
<TD>
#loop_counter#. #ListGetAt(some_list, loop_counter)#
</TD>
<CFIF col_counter eq 3>
</TR>
<CFSET col_counter = 0>
</CFIF>
<CFSET col_counter = col_counter + 1>
</CFLOOP>
</TABLE>
</CFOUTPUT>
Note that this displays the elements across the rows. If you had say 150
elements and wanted the first 50 elements in the first column, then you
should do this:
<CFOUTPUT>
<TABLE>
<TR>
<CFSET col_break = Int(ListLen(some_list)/3) >
<CFSET col_counter = 1>
<CFLOOP INDEX="loop_counter" FROM="1" TO="#ListLen(some_list)#">
<CFIF col_counter eq 1>
<TD>
</CFIF>
#loop_counter#. #ListGetAt(some_list, loop_counter)#<BR>
<CFIF col_counter gt col_break>
</TD>
<CFSET col_counter = 0>
</CFIF>
<CFSET col_counter = col_counter + 1>
</CFLOOP>
</TR>
</TABLE>
</CFOUTPUT>
-Chris Gilbert, Fodors.com
-----Original Message-----
From: Bob Wilson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 06, 2001 4:57 PM
To: CF-Server
Subject: Long list conversion to 3-column table
Sorry about the last email subject. Forgot to change it.
Here's my question again with less subject confusion.
--------------------
I feel I'm overlooking something simple, but this one is eluding my brain.
I have a long list of items that I want to display in 3 columns instead of
one
long list.
What do I need to do to take that list and put it into 3 columns in a
regular table?
Preferrably the columns would be as close as possible to the same size, but
some offset is OK.
Thanks for the help,
Bob Wilson
<============================================>
Bob Wilson
USA Sites - Web Application Design / Website Surveys
======> 5319 Cedar Heights Road
========> Knoxville, TN 37912
==========> USA
============> Phone: (865) 219-6906
==========> Toll Free FAX: 1 (866) 422-7585
========> Email: mailto:[EMAIL PROTECTED]
======> Website: http://www.usasites.com
<=============================================>
----------------------------------------------------------------------------
--
To unsubscribe, send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body or visit the list page at www.houseoffusion.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
------------------------------------------------------------------------------
To unsubscribe, send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body or visit the list page at www.houseoffusion.com