My question is:
How to make a table in javascript where the numbers of the table of 5 are interspersed in two columns, and the other two are blank?
This is the code:
function tabla() {
document.write("<table border='3' bgcolor='aqua'>");
var num = 0,
var resultado = 0;
for (var i = 0; i < 4; i++) {
for (var j = 0; j < 5; j++) {
if ((i % 2) == 0) {
document.write("<td>");
document.write(num += 5);
document.write("</td>");
} else {
document.write("<td>");
document.write("---");
document.write("</td>");
}
}
}
document.write("</table>");
}
And this is the result I hope to obtain: