JSFiddle - React, Tailwind, and code Playground
by Mujahid Pasha
HTML
<div id="content"></div>
JavaScript
var jsonList = [{name:'Jhon',address:'Jhon Address goes here',age:'27',status:'Single'},{name:'Smith',address:'Smith Address goes here' ,age:'32', status:'Single' }];
function createTable(){
var table = '<table border=1>';
for(var ind=0;ind< jsonList.length;ind++)
table += fetchRowInformation(jsonList[ind]);
document.getElementById('content').innerHTML = (table+'</table>');
}
function fetchRowInformation(json){
return '<tr><td> Name: ' + json.name + '</td>'+'<td> address: ' + json.address + '</td>'+ '<td> age: ' + json.age + '</td>'+'<td> status: ' + json.status + '</td></tr>';
}
createTable();