Necesita hacer una tabla que tenga números del 1 al 100, y debe tener 10x10 celdas. Hago celdas de 10x10 pero el resultado llena cada línea de la cuadrícula del 1 al 10, ¿cómo hacer que cada línea sea del 1 al 10, del 11 al 20 y del 100 al 100? Gracias por la atención a mi problema.
function generate_table() { const tbl = document.createElement("table"); const tblBody = document.createElement("tbody"); for (let i = 1; i < 11; i++) { const row = document.createElement("tr"); for (let j = 0; j < 10; j++) { const cell = document.createElement("td"); const cellText = document.createTextNode(i); cell.appendChild(cellText); row.appendChild(cell); } tblBody.appendChild(row); } tbl.appendChild(tblBody); document.body.appendChild(tbl); tbl.setAttribute("border", "1"); } <form action="#"> <input type="button" value="Generate a table" onclick="generate_table()"> </form> function generate_table() { const tbl = document.createElement("table"); const tblBody = document.createElement("tbody"); for (let y = 0; y < 10; y++) { const row = document.createElement("tr"); for (let x = 0; x < 10; x++) { const cell = document.createElement("td"); const cellText = document.createTextNode((x + 10 * y) + 1); cell.appendChild(cellText); row.appendChild(cell); } tblBody.appendChild(row); } tbl.appendChild(tblBody); document.body.appendChild(tbl); tbl.setAttribute("border", "1"); } <form action="#"> <input type="button" value="Generate a table" onclick="generate_table()"> </form>