I generally start by setting up two CSS classes, with similar names ending 
in 0/1.

<style type="text/css">
tr.rowstyle1 {
  background-color: #ffffff;
  }
tr.rowstyle0 {
  background-color: #e0e0e0;
  }
</style>
<cfoutput>
<cfloop query="somequery">
  <tr class="rowstyle#Evaluate('somequery.currentrow mod 2')#">
    ...
  </tr>
</cfloop>
</cfoutput>


Or you can use IIf() if not using CSS:

<cfoutput>
<cfloop query="somequery">
  <tr background="#IIf(somequery.currentrow mod 2, DE('##ffffff'), 
DE('##e0e0e0'))#">
    ...
  </tr>
</cfloop>
</cfoutput>



----- Original Message ----- 
From: "Robert Orlini" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, November 02, 2004 11:24 AM
Subject: mod command to alter row color


>I know this is an easy one, but can't find the right code.
>
> How do I have CF alternate color for each row of a table?
>
> Anyone have the code please?
>
> Thanks.
>
> Robert O.
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=35

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183163
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to