0
看着我的数据多维数组不循环,即将通过:可通过与车把
data: {
content: [
[
"School Name",
"Location",
"Type",
"No. eligible pupils",
"Average points per student",
"Average points per exam entry",
"% obtaining two facilitating subjects"
],
[
"Colchester Royal Grammar School",
"Colchester",
"State",
"349",
"1428",
"263.3",
"77%"
], and so on...
]
}
我通过这个阵列阵列试图循环,创建一个表。因此,对于每个阵列,我需要将其包装在<tr></tr>
中,并且对于每个阵列中的每个元素,我需要将它包装在<td></td>
中。我需要区分第一行,以便使用<thead>
和<th>
,但目前我正试图让我的头绕着正确的结构。
我的代码所做的只是创建一个包含整个事物的<td>
,而不是多个<tr>
s或<td>
s。
{{#each data.content}}
<tr>
{{#each this}}
<td>{{ this }}</td>
{{/each}}
</tr>
{{/each}}
是数据数组或数据对象ECT? – sundar
'data:[content:[]]'这个语法是错误的。不应该是'data:{content:[]}'? – Venugopal
1秒,出现错误,编辑现在.. – geodeath