0
I have a table where I need to duplicate the table columns when the ID changes in the received array.
The array consists of result=[{"id":"1","Dia":"250.0","inicial":"1050.0","final":"1050.0","DIAS":"800.0"},
{"id":"1","Dia":"250.0","inicial":"1050.0","final":"1050.0","DIAS":"800.0"},{"id":"2","Dia":"250.0","inicial":"1050.0","final":"1050.0","DIAS":"800.0"},{"id":"2","Dia":"250.0","inicial":"1050.0","final":"1050.0","DIAS":"800.0"}]
<table class="table table-striped">
<tr>
<th></th>
<th>Inicio</th>
<th>Fim</th>
<th>Total</th>
</tr>
<tr ng-repeat="r in result">
<td align="center">{{r.Dia}}</td>
<td align="center">{{r.inicial}}</td>
<td align="center">{{r.final}}</td>
<td align="center">{{r.DIAS}}</td>
</tr>
</table>
To get something like this:
Table:
That way would you have a replication of information for the two lines of results? Id1.dia and again Id1.dia under each other, it’s really like this ?
– Felippe Tadeu
yes because the same id can receive different values, so there may be similar data, in this array they are all the same only to exemplify
– Pnelson
Is there a rule for displaying this data ? What rule did you use to define that Id1 should be under Id1 ? If it had 2 more id being the value of them 3 would have once again the replica of these columns ?
– Felippe Tadeu
Yes, all id1 data is on the right and id2 on the left. Can receive up to 2 id’s or only 1 id or 2 id’s, no more than that
– Pnelson