I wrote some code a little while ago that will allow you to output your
query in multiple columns, each in a separate table element using little
simple (?!?) math and converting your query into an array.   =)

The MOD method in Hal's example will allow you to output such as :

1    2     3    4   5
6    7     8    9   10
11  12  13  14  15
16  17  18  19  20

The example code I am posting allows the display of the data in columns
vertically (not possible with the simple MOD method):

1  5  9    13  17
2  6  10  14  18
3  7  11  15  19
4  8  12  16  20


Hope it helps  =)

Nate Nielsen
[EMAIL PROTECTED]
www.fusionscript.com

------------------------CODE----------------------------

<cfdirectory action="LIST" directory="c:\" name="myDir">

<cfscript>
numOfColumns = 5;
myFiles = arrayNew(2);
 i = 1;
 </cfscript>
<cfloop query="myDir">
 <cfscript>
  myFiles[i][1] = myDir.name;
  myFiles[i][2] = myDir.size;
  myFiles[i][3] = myDir.type;
  i = i + 1;
 </cfscript>
</cfloop>

<table border="1">
<cfloop from="1" to="#val(ceiling(arrayLen(myFiles) / numOfColumns))#"
index="multiplier">
 <tr>
 <cfloop from="1" to="#numOfColumns#" index="i">
  <cfoutput>
   <cfset thisIndex = val((ceiling(arrayLen(myFiles) / numOfColumns)) * (i -
1) + (multiplier))>
   <cfif arrayLen(myFiles) GTE thisIndex>
    <td>#myFiles[thisIndex][1]#</td>
   <cfelse>
    <td>&nbsp;</td>
   </cfif>
  </cfoutput>
 </cfloop>
 </tr>
</cfloop>
</table>
----- Original Message -----
From: "Scott Raley" <[EMAIL PROTECTED]>
To: "CF-Community" <[EMAIL PROTECTED]>
Sent: Wednesday, May 22, 2002 5:38 AM
Subject: Re: help with link


> Two Column Output by Hal Helms.
>
> http://www.teratech.com/coldcuts/cutdetail.cfm?cutid=63
>
>
>
>
>
>
>
> [EMAIL PROTECTED] (Judith Dinowitz) on 05/21/2002 01:35:30 PM
>
> Please respond to [EMAIL PROTECTED]
>
> To:   CF-Community <[EMAIL PROTECTED]>
> cc:    (bcc: Scott Raley/LPEC/ASD/SEMCORINC)
>
> Subject:  Re: help with link
>
>
>
> Care to post the link?
>
> Thanks,
>
> Judith
>
> >Found the code I was lookin for at TeraTech...
> >
> >
> >
>
> 
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Archives: http://www.mail-archive.com/cf-community@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to