Reputation: 1615
I am using ng-repeat to form the rows in a table. For each row I need to display some data that needs to span across all the cells of that row.
<tr ng-repeat="cr in results.crs">
<td>cell 1</td>
<td>cell 2</td>
</tr>
I want something like this-
<tr ng-repeat="cr in results.crs">
<td>cell 1</td>
<td>cell 2</td>
</tr >
<td colspan=2>The Special Cell</td>
<tr>
</tr>
However ,ng-repeat doesn't allow two rows per repeat.I tried doing the following but doesn't work.
<tr ng-repeat="cr in results.crs">
<td>cell 1</td>
<td>cell 2</td>
</tr >
<td>The Special Cell</td>
<tr>
</tr>
Is there a way to add two rows per repeat?
Also,can anyone suggest any alternative way to do it? I am using table structure since its easier to design and I have basic knowledge of HTML+CSS.
Upvotes: 13
Views: 7646
Reputation: 2402
use
<tr ng-repeat-start="cr in results.crs">
<td>cell 1</td>
<td>cell 2</td>
</tr >
<tr ng-repeat-end>
<td>The Special Cell</td>
</tr>
see https://docs.angularjs.org/api/ng/directive/ngRepeat
Upvotes: 38