<cfif check if it j is 3, 6, 9, etc, if so,

Simplest way (I think) is <cfif j MOD 3 EQ 0>

Better is if you use a variable for your columns.

<cfif j MOD columnCount EQ 0>

> -----Original Message-----
> From: Adrian Lynch [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 25, 2002 9:14 AM
> To: CF-Talk
> Subject: RE: Display 3 column text *FOLLOWUP*
> 
> 
> <cfset j = "1">
> <cfloop list="#listElements#" index="i">
>       <cfoutput>#i#</cfoutput><cfif check if it j is 3, 6, 9, 
> etc, if so,
> <br> or start a new <tr>
> 
>       <cfset j = j + 1>
> </cfloop>
> 
> Ade
> 
> -----Original Message-----
> From: FlashGuy [mailto:[EMAIL PROTECTED]]
> Sent: 25 September 2002 13:46
> To: CF-Talk
> Subject: Display 3 column text *FOLLOWUP*
> 
> 
> Hi,
> 
> It just occured to me that the examples I've been receiving 
> might not work
> with my application. The line I'm grabbing from the database 
> and want to
> display in 3 columns is a 
> comma delimited line which could contain 5-100 names 
> separated by a comma.
> 
> inetpub,program files, test,temp
> 
> I need to loop through that string. In my case, 
> "#ListElement#" which would
> contain the above line "inetpub,program files, test,temp"
> 
> Am I making sense?
> 
> 
> Here is my code below. I still can't get it to display in 3 columns?
> 
> <cfquery name="ListElement" datasource="user-profiles" dbtype="ODBC">
>       SELECT      strUsername,strGroup,strSelect
>       FROM        profiles
>       WHERE       strUsername = '#auth#'
> </cfquery>
> 
> <table wisth="100%" cellpadding="6" cellspacing="0" border="0"
> align="center">
> <tr class="wdirlinks">
> <td colspan="2">
> <cfif COOKIE.DisplaySelect GT 0>
>       <cfloop index="ListElement" list="#COOKIE.DisplaySelect#"
> delimiters=",">
>       <cfoutput>
>       <table width="100%" cellpadding="2" cellspacing="2" border="0">
>       <tr>
>       <cfset x=1>
>       <cfif NOT x MOD 3></tr><cfif x NEQ
> #ListElement.RecordCount#><tr></cfif></cfif>
>       <cfset x = x + 1>
>       <td class="wdirlinks"><input type="checkbox" name="select"
> value="checked">#ListElement#</td>
>       </tr>
>       </table>        
>       </cfoutput>
>       </cfloop>
> <cfelse>
>       &nbsp;<b>None Selected</b>
> </cfif>
> </td>
> </tr>
> </table>
> 
> 
> ---------------------------------------------------
> Colonel Nathan R. Jessop
> Commanding Officer
> Marine Ground Forces
> Guatanamo Bay, Cuba
> ---------------------------------------------------
> 
> 
> 
> 
> 
______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to