我看到许多职位是如何把一个阵列变成一个表,但几乎是这样多。 页: 1
<table id="dataTable">
<tr>
<th>Functional Category</th>
<th>Brand Name</th>
<th>When Obtained</th>
<th>How Obtained</th>
<th>How Often Worn</th>
<th>Where Made</th>
<th>Has a Graphic</th>
</tr>
<tr>
<td>T-Shirt</td>
<td>threadless</td>
<td>Last 3 Months</td>
<td>Purchased</td>
<td>Monthly</td>
<td>India</td>
<td>Yes</td>
</tr>
<tr>
<td>T-Shirt</td>
<td>RVCA</td>
<td>2 Years Ago</td>
<td>Purchased</td>
<td>Bi-Monthly</td>
<td>Mexico</td>
<td>Yes</td>
</tr>
</table>
to:
var tableData = [
{
category: "T-shirt",
brandName: "threadless",
whenObtained: "Last 3 Months",
howObtained: "Purchased",
howOftenWorn: "Monthly",
whereMade: "India",
hasGraphic: "Yes"
},
{
category: "T-shirt",
brandName: "RVCA",
whenObtained: "2 Years Ago",
howObtained: "Purchased",
howOftenWorn: "Bi-Monthly",
whereMade: "Mexico",
hasGraphic: "Yes"
}
]
我期待着为此利用 j,并想知道实现这一目标的最佳途径是什么。