angularjs - Render array of arrays table in Angular using ng-repeat -


i have array of arrays (representing rows , columns) , need render html table data.

each row array of column values, example: $scope.table.row[0] = [123, 456, 789]

this attempt (that doesn't work). ideas?

<table>     <tbody>         <tr ng-repeat="row in table">             <td ng-repeat="col in row">{{col}}</td>         </tr>         </tbody> </table> 

you either need iterate on table.row or make table array of arrays itself. demo.

<table>     <tbody>         <tr ng-repeat="row in table.row">             <td ng-repeat="col in row">{{col}}</td>         </tr>         </tbody> </table> 

or

table = [ [123, 456, 789], [111, 222, 333], [111, 222, 333]]  <table>     <tbody>         <tr ng-repeat="row in table">             <td ng-repeat="col in row">{{col}}</td>         </tr>         </tbody> </table> 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -