I have a datasheet parsed from CSV to JSON by Papaparse, which I want to show dynamicly in a table. The data array looks like this, which is fresh from Papaparse:
data: {
0 {
_id: "",
Testcol: "cellvalue",
Testcol2: "cellvalue2"
},
1 {
...
}
}
I am now struggling to get this into HTML, since I do not know the values, since they are dynamic, I cant assume any name of the values.
I have tried the following:
<table class="table table-striped">
<thead>
<tr>
{{#each projectData.meta.fields}}
<th>{{this}}</th>
{{/each}}
</tr>
</thead>
<tbody>
{{#each row in projectData.data}}
<tr>
{{#each row}}
<td>
{{this}}
</td>
{{/each}}
</tr>
{{/each}}
</tbody>
</table>
But I get this error: Uncaught Error: {{#each}} currently only accepts arrays, cursors or falsey values.
How do I do this properly? I hope someone can point me in the correct direction.