私は2つのオブジェクトを持っておりresults
、headers
からheaders
生成されています_.keys(result[0])
r{
data:{
headers:['head1','head2']
result:[
{head1:'content1',head2:'content2'}
{head1:'content3',head2:'content4'}
{head1:'content5',head2:'content6'}
]
}
テーブルを動的に作成する必要があるため、これを作成します。
<table class="ui celled table segment">
<thead>
<tr>
{{#headers}}
<th>{{.}}</th>
{{/headers}}
</tr></thead>
<tbody>
{{#result:i}}
<tr>
{{#headers:h}}
<td>{{????}}</td> <-- Here is where I fail to know what to put into
{{/headers}}
</tr>
{{/result}}
</tbody>
</table>
誰かが空白を埋めるのを手伝ってくれますか. だから私は表示するテーブルを作成することができますcontents
パーツを削除し{{#headers}}
、要素が完全に機能することを既に知っている場合<td>{{.head1}}</td>
、問題はその場でさまざまなオブジェクトを生成していることです。