I have an Angular variable which has values in the form of an array as [ 170,1,130,3,134,4.... and so on]. I want to display it in Tabular form such that the values appear in the table in three columns for eg. first three values in first three columns of the first row, next three values in columns of the second row and so on.
col1 col2 col3
170 1 130
3 134 4
................
................
My Code
<span ng-repeat="obj in items">
<div ng-switch on="{{obj%3}}">
<div ng-switch-when="0">{{obj}}</div>
<div ng-switch-when="1">{{obj}}</div>
<div ng-switch-when="2">{{obj}}</div>
</div>
But this code is not working. Any suggestion would be useful.
Thanks in advance.
<span>is repeated for eachobj. What you will end up with is a series of<span>elements, each containing a<div>holding another<div>inside, but it won't have any effect on their layout on the page.