The Infamous "Green Bar" effect

Output database results in differing coloured tabledata's using the IIF function.

<CFQUERY dbtype="ODBC" datasource="Examples" name="DB_1">
Select Brand from Computers order by Brand
</CFQUERY>
<table border="0" cellpadding="2" cellspacing="0">
<cfoutput query="DB_1">
<tr><td bgcolor="###IIF(((CurrentRow MOD 2) IS 0),DE('008040'),DE('00C040'))#">#db_1.Brand#</td></tr>
</cfoutput>
</table>

 

Share this article!

Follow us!

Find more helpful articles: