Get a Quote Today!   |   + 1 (301) 424 3903




 
  Community
 
Need Help?
Visit our Training page
Request a Quote or Consultation
SIGN UP FOR THE TERATECH NEWSLETTER
 

ColdCuts

Cut: An even EASIER way to alternate table row colors...
Cut#: 306 
Cut Date: 03/07/2003 
Cutter: Bill Dodson 
Topic: Appearance 
Overview: This is a method that I came across to alternate table row colors for recordsets that beats any that I have used. Using a simple CFIF tag to return the modulus (remainder) of 2, you can easily alternate table row colors. Simple, direct, and functional is what CF is all about, right? :)

 

Cut Code:
<tr align="left" valign="top" <cfif YOUR_QUERY_NAME_HERE.currentrow MOD 2>
bgcolor="##FDEBCF"
<cfelse>bgcolor="##FFFFFF"
</cfif>>