I have a one-dimensional array of 100 positions and how do I draw a 10x10 array using a for loop.
<!DOCTYPE html>
<html>
<body>
<p id="demo"></p>
<script>
var x= [];
for (i=0; i< 100; i++)
{
x[i] = "X";
}
var texto;
texto = "<table>";
for (i=0; i< (x.length/100); i++)
{
texto += "<tr>";
for (i=(x.length)-1; i< x.length; i++) //como resolver isso? ????
{
texto += "<td>" + x[i] + "</td>";
}
texto += "</tr>";
}
texto += "</table>";
document.getElementById("demo").innerHTML = texto;
</script>
</body>
</html>