我尽可能简洁地描述一下问题。
eg:
[
{school:'haha',name:'xiaoming',id:'1001'},
{school:'haha',name:'zisi',id:'1002'},
{school:'haha',name:'zhangsan',id:'1003'},
{school:'xixi',name:'wangwu',id:'1004'},
{school:'xixi',name:'haoer',id:'1005'},
{school:'hehe',name:'xiaoliu',id:'1006'}
]
用的是angularjs1.x,把以上数据ng-repeat到表格里,想实现的效果是school相同的合并单元格,具体应该怎么实现,用不用操作数据格式呢?
第一步,排序数据。
第二步,计算
rowspan
。(因为这个值取决于“后面”的数据,所以只能先单独计算出来)第三步,渲染。