JSFiddle - React, Tailwind, and code Playground
HTML
<div id="div1"></div>
JavaScript
function drawTable() {
var div_id = document.getElementById('div1');
var tbl = document.createElement("table");
var totalRows = [];
tbl.setAttribute("id","table_id") ;
tbl.setAttribute("border","1") ;
div_id.appendChild(tbl);
for(var i=0;i<5;i++){
var row=tbl.insertRow();
totalRows[i]= new Array();
for(var j=0;j<10;j++){
var cell=row.insertCell();
cell.setAttribute("width","100px") ;
cell.setAttribute("height","35px") ;
cell.innerHTML = " "+j;
}
}
document.body.appendChild(tbl);
}
drawTable();