I'm trying to create a simple table with jQuery.
Currently I got on the browser one single black cube,
while the goal is to have table with 5 rows and 5 cols cubes colored black.
Html:
<table class="t"> </table>
CSS:
.box {
width:50px;
height:50px;
background-color:black
}
JS
let $table = $('.t')
let $td = $('<td>').addClass('box')
for (let i = 0; i < 5; i++)
{
let $tr = $('<tr>')
for (let k = 0; k < 5; k++) {
$tr.append($td)
$table.append($tr)
}
$tr.appendTo($table);
}