Prendela con le molle perchè è una prima bozza
ad ogni modo guarda se ti viene l'ispirazione 
Codice PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="JavaScript" type="text/JavaScript">
function _createElement(el,obj){
var _el= document.createElement(el);
for(var prop in obj){
if(prop=='class'){
//fix ie behaviour
_el.className= obj[prop];
}
_el.setAttribute(prop,obj[prop]);
}
return _el;
};
function _createTextNode(text){
return document.createTextNode(text);
};
function Grid(target){
this._target= target;
this.display=function(){
this._table.cellSpacing= this._cellSpacing;
this._table.cellPadding= this._cellPadding;
this._target.appendChild(this._table);
}
this.setTable= function(cs,cp,obj){
this._table= _createElement('table',obj);
this._cellSpacing = cs;
this._cellPadding = cp;
}
this.setHeader=function(headers){
this._thead= document.createElement('thead');
var _tr= document.createElement('tr');
for (var i = 0; i < headers.length; i++){
var _th = document.createElement('th');
_th.appendChild(document.createTextNode(headers[i]));
_tr.appendChild(_th);
}
this._thead.appendChild(_tr);
this._table.appendChild(this._thead);
}
this.setBody=function(data){
this._tbody= document.createElement('tbody');
for (var i = 0; i < data.length; i++){
var _tr= document.createElement('tr');
for(var prop in data[i]){
var _td = document.createElement('td');
_td.appendChild(document.createTextNode(data[i][prop]));
_tr.appendChild(_td);
}
this._tbody.appendChild(_tr);
}
this._table.appendChild(this._tbody);
}
this.build=function(){
}
}
window.onload=function(){
var mybody =document.getElementsByTagName("body")[0];
var _table= new Grid(mybody)
_table.setTable(5,5,{'with':'500','class':'mytable'});
_table.setHeader(['ID','Title','Description']);
var p= [{'id':1,'title':'Hello','description':'hello descr'},{'id':1,'title':'Hello2','description':'hello2 descr'}];
_table.setBody(p);
//_table.build();
_table.display();
}
</script>
</head>
<body>
</body>
</html>