js 将json数据自动绑定到 html table 表格中

/*自動綁定到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"; 
  }
  h+="";
}
h+="
"+headColumn+"
" document.getELementById("div1").innerHTML = h;

你可能感兴趣的:(JavaScript)