Skip to content

Instantly share code, notes, and snippets.

@nastanford
Created September 4, 2012 11:52
Show Gist options
  • Save nastanford/3620559 to your computer and use it in GitHub Desktop.
Save nastanford/3620559 to your computer and use it in GitHub Desktop.
ColdFusion - Function - Alternating Row Colors
<cfscript>
// Alternating Row (classes, bgcolor, or any other alternating row useage)
// example: alternatingRow(TheCurrentRowCount,EvenRowText,OddRowText)
function alternatingRow(currentRow,evenRow,oddRow) {
var returnVar = IIF(currentRow Mod 2, DE(evenrow), DE(oddrow));
return returnVar;
}
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment