JSFiddle - React, Tailwind, and code Playground
HTML
<table id='chezz'>
</table>
JavaScript
document.addEventListener("DOMContentLoaded", () => {
let ches = document.getElementById("chezz");
ches.style.border = "1px solid tomato";
ches.style.borderSpacing=0;
for (let i = 0; i < 8; i++) {
let tr = document.createElement("tr");
ches.appendChild(tr);
for (let k = 0; k < 8; k++) {
let tCell = document.createElement("td");
if ((k + i) % 2 == 0) {
tCell.style.backgroundColor = "#000000";
}
tCell.style.width = "40px";
tCell.style.height = "40px";
tCell.style.padding = 0;
tr.appendChild(tCell);
}
}
});