Looking at my data that is coming through:
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...
]
}
I am trying to loop through this array of arrays, to create a table. So for each array I would need to wrap it in <tr></tr> and for each element inside every array I need it wrapped in a <td></td>. I will need to differentiate the first row to use <thead> and <th> as well but at the moment I am trying to get my head around the proper structure.
What my code does is create only one <td> containing the whole thing, rather than multiple <tr>s or <td>s.
{{#each data.content}}
<tr>
{{#each this}}
<td>{{ this }}</td>
{{/each}}
</tr>
{{/each}}
data: [ content: []]this syntax is wrong. shouldn't it bedata: { content: [] }?