0
我有一些具有挑戰性的要求,並尋找解決方案來動態呈現它。我會請專家來幫助我解決以下問題。通過JSON數據呈現動態表格
我需要呈現的數據按照上面的格式,如果需要JSON數據看起來以下的模板和更新
[ { Region: 'India' State: 'MH' Month: 'jan-16' visits: 10230157 }, { Region: 'India' State: 'DL' Month: 'jan-16' visits: 20023423 }, { Region: 'India' State: 'TL' Month: 'jan-16' visits: 38023804 }, { Region: 'India' State: 'RJ' Month: 'jan-16' visits: 65102322 }, { Region: 'India' State: 'KN' Month: 'jan-16' visits: 80234109 } ]
用作按照您的解決方案。
<div class="tablecontainer" ng-if="groups.length > 0" ng-repeat="cat in groups">
<div class="row rowspace">
<div>{{cat.group.name}}</div>
<div ng-if="cat.group.columns.length>0" ng-repeat="column in cat.group.columns">
<div>{{column.name}}</div>
</div>
</div>
<div class="row">
<table class="table table-striped table-bordered">
<tr>
<th ng-repeat="column in cat.cols">{{column}}</th>
</tr>
<tr ng-repeat="row in cat.rows">
<td ng-repeat="column in cat.cols">{{row[column]}}</td>
</tr>
</table>
</div>
</div>
這將是非常有益的,並感謝您的幫助。
謝謝
謝謝Faly。讚賞你的時間和努力。我需要動態呈現列,並且還需要顯示一個問題(由於內部數組排序)。我會處理我自己的這些事情。再次感謝您的幫助。 –