I'm not exactly sure what you mean when you say 
you're "manually writing table rows", but if I'm 
guessing correctly, the following should be one 
way to solve your problem.

At the top of your page, using CFSET or CFPARAM 
create a variable that will be incremented each 
time a table row is started.

<cfset counter=0>

Then when you begin a table row, increment that variable and then 
set the bgcolor based on the current value of that variable.

<TR bgcolor="<cfset counter=counter+1><cfif counter MOD
2>E9E7Cf<cfelse>FFA768</cfif>">




-----Original Message-----
From: Ryan [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 15, 2000 12:14 PM
To: CF-Talk
Subject: Alternating TR colors


Lets say I wanted the background color of each row in a table to be
different colors. I found this code:

COLOR=###IIF(QueryName.currentrecord MOD 2, DE ('E9E7CF'), DE ('FFA768'))#

But I'm not looping through a query, I'm just manaully writing table rows,
BUT, some of the rows may not always be displayed, so I can't just hardcode
the color values, because then you'd have two rows right after each other
that are the same color.

In perl I would just write a function that increments a counter and returns
the new result. Like:

COLOR=###IIF(MyIncrementFunc(counter) MOD 2, DE ('E9E7CF'), DE ('FFA768'))#

How can I accomplish this in ColdFusion?

Thanks,

Ryan
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists