1
<table border=1>
 <thead>
   <tr>
      <th>Group</th>
      <th>Status</th>
     <th>Name</th>
     <th>Gender</th>          
   </tr>
 </thead>    
 <tbody ng-repeat="group in groups">
   <tr>
     <td rowspan="3">{{group.name}}</td>  
     <td rowspan="3">{{group.status}}</td>        
   </tr>
   <tr ng-repeat="member in group.members">
     <td>{{ member.name }}</td>
     <td>{{ member.gender }}</td>
   </tr>
 </tbody>
</table>

上面的代码给出的输出如下:

在此处输入图像描述

我需要使Status列成为第 4 列而不是当前的第 2 列,即出现在Gender列之后。我尝试通过添加一个tr具有状态的 ng-repeat-start 来使用它,td但它是另一行

JS-Bin相同

4

1 回答 1

1

对带有 a 的列ng-if检查using $indexmodulo ( )可能会解决问题:jsbin.com/jaxuvavaba%rowspan

于 2015-04-26T16:25:31.717 回答