IIF in an Inline IF statement, so only has boolean TRUE and FALSE (ie.
two states). If you want to vary between more use a switch/case setup again
dependent on the mod and rowcount. The nicest thing about the iif() is it's
inline and clean looking in your code; any type of if/elseif or switch
statments are either going to be slightly removed from the line or not look
as nice... but they work.
<cfscript>
// determine row colour based on mod of current query row
switch (DirList.CurrentRow mod 3) {
case 0:
colour = "ffffe7" ;
break;
case 1:
colour = "fafafa" ;
break;
case 2:
colour = "a1a1a1" ;
break;
}
</cfscript>
<tr bgcolor="#colour#">
If you want gradients of a single colour you could also use mod to
generate it mathmatically, instead of a sub type operation.
<tr bgcolor="0909#evaluate((DirList.CurrentRow mod 3) * 3)#9">
-----Original Message-----
From: Jay Patton [mailto:[EMAIL PROTECTED]]
Sent: January 17, 2001 15:52
To: CF-Talk
Subject: any ideas?
does anyone know how i can make this tag output 3 colors instead of 2?
<tr bgcolor="#IIf(DirList.CurrentRow Mod 2, DE('FFFFE7'), DE('FAFAFA'))#">
thanks,
Jay Patton
Web Pro USA
406.549.3337 ext. 203
1.888.5WEBPRO
www.webpro-usa.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists