I created multiplication table using for loop
now I need to create the same table with numbers 1 to 100 like this one:[table][1]
how do I create this one
[1]: https://i.stack.imgur.com/FAacu.png
document.write('<table border="3">');
for (var x = 1; x < 11; x++) {
document.write("<tr>")
for (let i = 1; i < 11; i++) {
document.write("<td>" + x * i + "</td>")
}
document.write("</td>")
}
document.write("</table>")
>Solution :
I have looked into your code and seems like logic inside your for loop is not correct.
I am posting a working code logic for this, I hope this is what you need.
document.write('<table border="3">');
for (var x = 1; x <= 100; x += 10) {
document.write("<tr>");
for (let i = x; i <= x + 9; i++) {
document.write("<td>" + i + "</td>");
}
document.write("</td>");
}
document.write("</table>");