/* for (var i=1; i<=10; i++) {
for(var b=1; b<=10; b++){
//document.write("AB")
if(b%2==1){document.write('<span style="color: crimson;">A</span><span style="color: cornflowerblue;">B</span>')}
else{document.write('<span style="color: cornflowerblue;">A</span><span style="color: crimson;">B</span>')}
};
document.write("<br>");
}; */
for (var i=1; i<=10; i++) {
if (i%2==1) {
for(var b=1; b<=10; b++){
//document.write("AB")
if(b%2==1){document.write('<span style="color: crimson;">A</span><span style="color: cornflowerblue;">B</span>')}
else{document.write('<span style="color: cornflowerblue;">A</span><span style="color: crimson;">B</span>')}
};
} else{
for(var b=1; b<=10; b++){
//document.write("AB")
if(b%2==1){document.write('<span style="color: cornflowerblue;">A</span><span style="color: crimson;">B</span>')}
else{document.write('<span style="color: crimson;">A</span><span style="color: cornflowerblue;">B</span>')}
};
}
document.write("<br>");
};
奇数行 奇数列为红色 偶数列为蓝色
<span style="color: crimson;">A</span>
<span style="color: cornflowerblue;">B</span>