I have this code right here.. where the variable num is the dimension of a n by n square table. The objective is to enter a number and create a table with the number as the dimension.
I got this code but it doesn't go through the 2 layers of for-loops. After the code execution, the string *change_text* just becomes: <table></table>
change_text = "<table>";
for (var i; i<num; i++) {
change_text = change_text + "<tr>";
for (var j; j<num; j++) {
change_text = change_text + "<td> asdf </td>";
//code for blue cells
}
change_text = change_text + "</tr>";
}
change_text = change_text+ "</table>"
You need to initialize your iterators:
for(var i = 0; i < num; i++)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With