Looking to create a table in Angular.js with cells that span multiple rows.
For example, check out this example.
Here's some sample data:
var data = [{Colors: ["red","green","blue"]}]
Desired output:
<table>
<tr>
<td rowspan="3">Colors</td>
<td>red</td>
</tr>
<tr>
<td>green</td>
</tr>
<tr>
<td>blue</td>
</tr>
</table>
I currently have it set up using the ng-show
directive, but this still creates an extra cell that is hidden. I'm hoping for a proper rendering of the table without any extras.
Using ng-switch
isn't an option due to strict parsing limitations in certain elements like tables.
Any suggestions on how to achieve this?