Witam, potrzebuje do mojej tabliczki mnożenia 100x100 dodać tak żeby każde pole tabelki miało tło w losowo wybranym kolorze. Pomoże ktoś? Coś napisałem ale nie do końca działa tak jak powinno
const table = document.getElementById('obszar');
const rnd = () => Math.floor(Math.random() * 256);
for (let y = 1; y <= 100; y++) {
const tr = document.getElementById('tr');
for (let x = 1; x <= 100; x++) {
const td = document.getElementById('td');
td.innerText = y * x;
tr.appendChild(td);
td.style.background = `rgb(${rnd()}, ${rnd()}, ${rnd()})`;
}
table.appendChild(tr);
}