You'd have to create a table, and loop through it to create the individual cells.
PHP Code:
var table = document.createElement("table");
var tbody = document.createElement("tbody") // you need this for IE :(
for (var i = 0; i < y.length; i++) {
var tr = document.createElement("tr");
for (var j = 0; j < x.length; j++) {
var td = document.createElement("td");
var val = 2*2;
var txt = document.createTextNode(val);
td.appendChild(txt);
tr.appendChild(td);
}
tbody.appendChild(tr)
}
table.appendChild(tbody);
document.appendChild(table);
Don't know if thats 100% correct, but you can see how its done.
Bookmarks