[thelist] Cold Fusion Column Formatting

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


> I've been asked to take a table, laid out from an
> Access database in a 3-column format and alphabetize
> by row, rather than column using Cold Fusion.
> http://www.mrrl.org/services/refer/links/index.cfm.

hi robin

you mean by column rather than by row   ;o)

in other words, down the first column, up to the top of the next column,
down that column, and so on

the basic strategy is to run your query, do a cfoutput loop on the query
results, dropping each url/title pair into a 2-dimensional array, then do a
cfloop through the array, outputting three cells at a time from the array
into each row as you go down the table

there's a bit of math that's required so that if you don't start with an
exact multiple of three, you don't try to fill in table cells at the end of
the table with array entries that aren't there

i have working cf code which does exactly what you want, i'll send it to
you offlist if you want it


rudy

p.s. i think you might want to use the URLEncodedFormat function on your
titles, because your links are your titles and they have spaces in them,
e.g. --

  <a href="detail.cfm?category=Business And Economics"
     >Business And Economics</a>





More information about the thelist mailing list