What do you mean by dynamically alternate row colours? Are you generating the html for the rows dynamically? If so, you'll have to dynamically indicate the class of the rows too. Example, in your css:
.row1 {background-color: black};
.row2 {background-color: white};
Then in the script used to dynamically create the table, alternate between printing the row1 and row2 class:
foreach (rowelement) {
if ($rowname = 'row1') $rowname = 'row2';
else $rowname = 'row1';
print "<tr class=$rowname>";
}