答案 0 :(得分:6)
...
var orderArrayHeader = ["S.No","Date","Product Name","Client Name"];
...
var thead = document.createElement('thead');
table.appendChild(thead);
for(var i=0;i<orderArrayHeader.length;i++){
thead.appendChild(document.createElement("th")).
appendChild(document.createTextNode(orderArrayHeader[i]));
}
...
答案 1 :(得分:0)
使用
<table>
<thead>
<tr>
<th>S.No</th>
<th>Date</th>
<th>ProductName</th>
<ht>ClientName</th>
</tr>
</thead>
做一些造型,你会得到你想要的......