我有这个 JSON 结果:
{
"html_content": [
[
[
"Navegantes",
"11",
"8",
"3",
"0"
]
],
[
[
"Tigres",
"11",
"8",
"3",
"0"
]
],
[
[
"Caribes",
"11",
"6",
"5",
"2"
]
],
[
[
"Leones",
"11",
"6",
"5",
"2"
]
],
[
[
"Aguilas",
"11",
"5",
"6",
"3"
]
],
[
[
"Tiburones",
"10",
"4",
"6",
"3.5"
]
],
[
[
"Cardenales",
"10",
"3",
"7",
"4.5"
]
],
[
[
"Bravos",
"11",
"3",
"8",
"5"
]
]
]
}
我需要为每个这样的 HTML 标记构建:
<tr>
<td>Navegantes</td>
<td>11</td>
<td>8</td>
<td>3</td>
<td>0</td>
<td>
<span class="glyphicon glyphicon-play"></span>
<span class="glyphicon glyphicon-stop"></span>
</td>
</tr>
<tr>
<td>Tigres</td>
<td>11</td>
<td>8</td>
<td>3</td>
<td>0</td>
<td>
<span class="glyphicon glyphicon-play"></span>
<span class="glyphicon glyphicon-stop"></span>
</td>
</tr>
依此类推,我编写了以下代码:
$.each(data.html_content, function(i, v) {
htm += "here goes the HTML code";
});
但这不起作用我认为由于数组类型,有什么帮助吗?