EDIT this is a similar (or duplicate) of Angular.js ng-repeat across multiple elements
-
i have a table, whose rows are generated via ng-repeat:
<tr ng-repeat="(key, value) in rows">
<td>{{a}}</td>
<td>{{b}}</td>
</tr>
i'd really prefer to keep it in <table> tag, and not several inline-blocks, for various reasons.
How can I add another row just below each row, e.g. pseudo-code
[ somehow-repeat ng-repeat="(key, value) in rows"]
<tr class="1">
<td>{{a}}</td>
<td>{{b}}</td>
</tr>
<tr class="1">
<td colspan="2">
</tr>
[ /somehow-repeat ]
as far as i know (worth checking) i can't wrap the TR inside another element. just chekced :( the table doesn't show if i the "somehow-repeat" element is or
so - is there a way to add new row despite being in ng-repeat?
You can use repeat-start and repeat-end:
<tr class="1" ng-repeat-start="(key, value) in rows">
<td>{{a}}</td>
<td>{{b}}</td>
</tr>
<tr class="1" ng-repeat-end>
<td colspan="2">
</tr>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With