OK, I am very new to these things. I thought I got the DOM sense right but my code is not working. The task is to create a table like
this
This is the piece I did. Could you please help me out with pointing out at the mistake I made or parts missing in my code? Every help very much appreciated.
const tableValues = new Array(10).fill(false).map((x, i) => {
return new Array(10).fill(1).map((y, i2) => {
return (i + 1) * i2
})
})
document.addEventListener('DOMContentLoaded', tableCreate, false);
function tableCreate() {
const table = document.getElementById("table");
tableValues.forEach((row) => {
const row = document.createElement("tr")
row.forEach(cell => {
const cell = document.createElement("td");
cell.innerHTML = cellText;
cell.appendChild(cellText)
}
row.appendChild(cell))
})
table.appendChild(body)
}
<table>
<tbody id="table"></tbody>
</table>