【发布时间】:2016-05-24 22:02:27
【问题描述】:
我正在使用 ng-repeat 来形成表格中的行。对于每一行,我需要显示一些需要跨越该行所有单元格的数据。
<tr ng-repeat="cr in results.crs">
<td>cell 1</td>
<td>cell 2</td>
</tr>
我想要这样的东西-
<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>
但是,ng-repeat 不允许每次重复两行。我尝试执行以下操作但不起作用。
<tr ng-repeat="cr in results.crs">
<td>cell 1</td>
<td>cell 2</td>
</tr >
<td>The Special Cell</td>
<tr>
</tr>
有没有办法每次重复添加两行?
另外,任何人都可以提出任何替代方法吗?我正在使用表格结构,因为它更易于设计并且我具有 HTML + CSS 的基本知识。
【问题讨论】:
-
您应该尝试使用
<div ng-repeat=" "> <tr> <td> cell 1</td></tr> </div>可能会奏效
标签: angularjs html-table ng-repeat