var rows = 15;
var colors = ['red', 'green', 'blue'];
var color = 0;
for (var i = 0; i < rows; i++) {
document.write('<tr bgcolor="' + colors[color] + '">');
document.write('<td>Cell 1</td><td>Cell 2</td>');
document.write('</tr>');
color = ++color % colors.length;
}