Ed Wong wrote:

>I tried to add different colours to the <TR> but keep getting an error. Can't 
>I do this with a CFLOOP or do I need to do a <cfloop query?
>  
>
[snip]

><tr bgcolor="<cfoutput>#bgColor(currentRow MOD 
>2,'##CCCCCC','##ABABAB')#</cfoutput>">
>  
>
You don't need the function, just use a CFIF or an inline IF as I 
mentioned in another post today.

<tr bgcolor="#IIF(currentrow MOD 2,DE('#CCCCCC'),DE('#ABABAB'))#">

However, currentrow is an attribute of a query, so what you need to do 
is keep a count of the current row as you loop through your list.

<cfset variables.thisRowNumber = 0>
<cfloop index="listrow" list="#logfile#" delimiter="#chr(10)#">
        <cfset variables.thisRowNumber = 
IncrementValue(variables.thisRowNumber)>
        <tr bgcolor="#IIF(variables.thisRowNumber MOD 
2,DE('#CCCCCC'),DE('#ABABAB'))#">
        .
        .
        .
</cfloop>

I'm not sure where your CFOUTPUT is, but you will need one around the 
anywhere you want to output variables etc.

Regards

Stephen


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:15:923
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/15
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:15
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to