jsはjsonデータを自動的にhtmlテーブルに結び付けます.

576 ワード

/*     table*/
var f = new Function("+[{id:"1",name:"aa"},{id:"2",name:"bb"}]+");
var list = f();
var h= "";
h+= ""
for(var headColumn in list[0]){
  h+=""
}
h+=""";
for(var i=0;i"
  for(var row in list[i]){
    h+=""; 
  }
  h+="";
}
h+="
"+headColumn+"
"+list[i][row]+"
" document.getELementById("div1").innerHTML = h;