You are here: irt.org | FAQ | ColdFusion | Q3002 [ previous next ]
As an example, the following code alternates between white and a light gray. If (CurrentRow MOD 2) is 0 (i.e. the row number is an even number), it uses the first color value, otherwise (odd number) it uses the second color value.
<table> <cfoutput query="myQuery"> <tr bgcolor="###Iif(((CurrentRow MOD 2) is 0),de('cccccc'),de('ffffff'))#"> <td>#Field1#</td> <td>#Field2#</td> </tr> </cfoutput> </table>