var table = document.getElementById("product_table");
var rows = table.getElementsByTagName("tr");
for ( var i = 0; rows[i]; i++ ) {
var cells = rows[i].getElementsByTagName("td");
for ( var j = 0; cells[j]; j++ ) {
if ( (i + j) % 2 ) {
cells[j].style.backgroundColor = "#CCC";
}
}
}