Tag Archives: jQuery

Creating alternating row colors on a table in ColdFusion using jQuery

In a previous example, “Creating alternating row colors on a table in ColdFusion”, we saw how you could add alternating row colors on an HTML table in ColdFusion by looping over a database query and using the query currentRow attribute and the MOD operator to determine if the current row number is “odd” or “even”.

The following example shows how you can use jQuery to dynamically set the CSS backgroundColor style if the current table row is “odd” or “even”.

Continue reading