That's a very, very nice idea. For a bit more added speed though, use array
assignment (given longer list or number of rows).
<cfset rowColour = listToArray("FFFFE7,FAFAFA,808080")>
...
<tr bgcolor="rowColour[(query.currentrow mod 3) + 1]">
...
Your solution is quite elegant Scott, I just added it to my bag of tricks :)
Thanks.
As a side note, you can also do alternating rows by CSS as defined by W3C.
In praticallity though no browser I'm aware of supports it properly.
-----Original Message-----
From: Scott Weikert [mailto:[EMAIL PROTECTED]]
Sent: January 19, 2001 13:14
To: CF-Talk
Subject: Re: any ideas?
Or...
(up higher in the file)
<CFSET RowColorList = "FFFFE7,FAFAFA,808080">
Then
<tr bgcolor = "#ListGetAt(RowColorList, ((CurrentRow MOD 3) + 1))#">
--Scott
----- Original Message -----
From: "Russel Madere" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, January 19, 2001 7:53 AM
Subject: RE: any ideas?
> Use:
>
> <tr bgcolor="<cfif DirList.CurrentRow Mod 3 EQ 0>#FFFFE7<cfelseif
> DirList.CurrentRow Mod 3 EQ 1>#FAFAFA<cfelse>#808080</cfif>">
>
> Russel
>
> ============================================================
> Russel Madere, Jr. Senior Web Developer
> ICQ: 5446158 http://www.TurboSquid.com
>
> Some days you eat the bear; some days the bear eats you.
> ============================================================
>
>
> > -----Original Message-----
> > From: Jay Patton [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, January 17, 2001 14: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/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists