Chad Gray asked: > When using a <CFOUTPUT QUERY=""> tag on a table how do i get every other > <TD> to have a background color? My favorite way: <STYLE> .evenrow { background-color: silver; } .oddrow { background-color: gray; } </STYLE> <CFSET EvenOdd=ListToArray("oddrow,evenrow")> <CFOUTPUT> <TABLE> <CFLOOP QUERY="foo"> <TR CLASS="#EvenOdd[IncrementValue(CurrentRow MOD 2)]#"><TD>#CurrentRow#</TD></TR> </CFLOOP> </TABLE> </CFOUTPUT> This allows me to define any styles I want in the STYLE part, including background color, fonts, etc. But then, I'm a CSS nut ... Plus I like using the MOD function and arrays. Takes me back to my C days when programming was so much more fun. ;) -R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Alternating BG colors on a
Rick Osborne [Mojo]
Tue, 21 Aug 2001 14:41:46 -0700
- Storing complex data types Aidan Whitehall
- RE: Storing complex data types Brent Goldman
- RE: Storing complex data types Rich Wild
- Longish comments on XML... was RE: Storing co... Dick Applebaum
- Re: Longish comments on XML... was RE: St... Joseph Thompson
- Alternating BG colors on a <TD> Chad Gray
- RE: Alternating BG colors on a &... John Wilker
- RE: Alternating BG colors on a &... Bill King
- RE: Alternating BG colors on a &... Rick Osborne [Mojo]
- RE: Alternating BG colors on a &... Steven Dworman
- Re: Longish comments on XML... was RE... Dick Applebaum
- RE: Storing complex data types Aidan Whitehall
Reply via email to
Rick Osborne [Mojo] Tue, 21 Aug 2001 14:41:46 -0700
- Storing complex data types Aidan Whitehall
- RE: Storing complex data types Brent Goldman
- RE: Storing complex data types Rich Wild
- Longish comments on XML... was RE: Storing co... Dick Applebaum
- Re: Longish comments on XML... was RE: St... Joseph Thompson
- Alternating BG colors on a <TD> Chad Gray
- RE: Alternating BG colors on a &... John Wilker
- RE: Alternating BG colors on a &... Bill King
- RE: Alternating BG colors on a &... Rick Osborne [Mojo]
- RE: Alternating BG colors on a &... Steven Dworman
- Re: Longish comments on XML... was RE... Dick Applebaum
- RE: Storing complex data types Aidan Whitehall