Skip to content Skip to sidebar Skip to footer

Ng-repeat Values With 3 Columns In Table? - AngularJS

I'm trying to display data in 3 column table format. With the below code am able to get data in 3 column format but I want it in proper table, with tr and td.
$scope.data = [
    ["opt1", "opt2", "opt3"],
    ["opt1", "opt2", "opt3"],
    ["opt1", "opt2", "opt3"]
];

You could then do a simple inner ng-repeat

<table>
    <tr ng-repeat="row in data">
        <td ng-repeat="column in row">{{column}}</td>
    </tr>
</table>

Demo: http://jsfiddle.net/JG3A5/75/


Post a Comment for "Ng-repeat Values With 3 Columns In Table? - AngularJS"