problem description
give the original data:
var data = [
{
title: "",
sex: "",
age: "22",
address: ""
},
{
title: "",
sex: "",
age: "24",
address: ""
}
];
as above, how to compare two or more objects in an array and draw
with Table
the expected results are as follows:
< table >
< thead > < tr >
< th > title < / th >
< th > Zhang San < / th >
< th > Li Si < / th >
< / tr > < / thead >
< tbody >
< tr >
< td > sex < / td >
< td > male < / td >
< td > male < / td >
< / tr >
< tr >
< td > age < / td >
< td > 22 < / td >
< td > 24 < / td >
< / tr >
< tr >
< td > address < / td >
< td > Jixiang Village < / td >
< td > Yuhua Village < / td >
< / tr >
< / tbody >
< / table >