Here is my own little routine that moves a table from the DB to a Table. This is a call back, the stack preset by a dispatcher. The handy tdStr and thStr make the html formats.
function output(me) {
if(me.numrows == 0) return;
var strOut = "<table class='sql' ><tr>";
for(key in me.results.rows[0])
strOut += thStr(key);
strOut += "</tr>";
for(var i = 0; i < me.numrows;i++) {
strOut += "<tr>";
for(key in me.results.rows[i])
strOut += tdStr(me.results.rows[i][key]);
strOut += "</tr>";
}
strOut += "</table>"
dbStatus.innerHTML += strOut;
}
No comments:
Post a Comment