<table>
<tbody></tbody>
</table>
table, td {
border: 1px solid #CCC;
border-collapse: collapse;
}
td {
padding: 5px;
text-align: center;
font-family: Helvetica, Tahoma, sans-serif;
color: #333;
}
const length = 10;
const tbody = document.querySelector('table > tbody');
Array.from({length}, () => {
const tr = document.createElement('tr');
tr.classList.add('line');
Array.from({length}, () => {
const n = 1 + Math.random() * 100 | 0;
const td = document.createElement('td');
td.classList.add('box');
td.innerText = n;
tr.appendChild(td);
});
tbody.appendChild(tr);
});
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.