<script type="text/javascript">
var str, sel, n = 10, i, j;
document.write("<table>");
for (i = 0; i < n; i++) {
document.write("<tr>");
for (j = 0; j < n; j++) {
sel = (i + j)%4;
if (sel == 0 || sel != 2) {
str = "class='r1'";
} else {
str = "class='r2'";
}
document.write("<td " + str + "></td>");
}
document.write("</tr>");
}
document.write("</table>");
</script>