JSFiddle - React, Tailwind, and code Playground

by Trifan Alexandru

CSS

#gigi {
    width: 200px;
    height: 200px;
}

JavaScript

var output = [{id: 1, name: 'Alex', phone: '000'}, {id: 2, name: 'Paul', phone: '010'}];
var table = $('<table border="1"></table>');
for(var i=0; i < output.length; i++) {
   var tr = $('<tr></tr>');
   for(var key in output[i]) {
     var td = $('<td></td>');
     td.attr('class', key);
     td.text(output[i][key]);
     tr.append(td);
   }
   table.append(tr);
}

$('body').append(table);