Javascript 表中的常规表
我得到了下面的html。我剪了几列Javascript 表中的常规表,javascript,html,angularjs,ngtable,Javascript,Html,Angularjs,Ngtable,我得到了下面的html。我剪了几列 <table ng-table="NewIntroCtrl.tableParams" class="table table-striped table-bordered table-hover table-condensed" sortable="true"> <tr ng-repeat="pilot in $data"> <td data-title="'Licensee Id'">
<table ng-table="NewIntroCtrl.tableParams" class="table table-striped table-bordered table-hover table-condensed" sortable="true">
<tr ng-repeat="pilot in $data">
<td data-title="'Licensee Id'">{{pilot.license}}</td>
<td data-title="'Licences'">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Endorsement</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="licence in pilot.licences">
<td>{{licence}}</td>
</tr>
</tbody>
</table>
</td>
<td data-title="'Origin'">{{pilot.origin}}</td>
</tr>
</table>
除了我生成的表在许可证的右边有一个空的列标题这一事实之外,所有这些都可以工作。此外,从这一点上看,内容放置错误。
我可以将表放在ng table td元素中吗?快速查看ngTable源代码和ngTable指令表明,当函数位于一行时,它可能会在td元素上执行jQuery查找,这意味着它不仅选择直接子元素,而且选择所有子元素,但是该函数中有一个“忽略单元格”选项
angular.forEach(row.find('td'), function(item) {
var el = angular.element(item);
if (el.attr('ignore-cell') && 'true' === el.attr('ignore-cell')) {
return;
}
修复
<td data-title="'Licences'">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Endorsement</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="licence in pilot.licences">
<td ignore-cell="true">{{licence}}</td>
</tr>
</tbody>
</table>
</td>
背书
{{许可证}
在标题显示上添加此选项修复了我的标题显示问题。它消除了额外的列,但现在我的列没有标题了。您将“忽略单元格”属性添加到了哪些单元格?它应该在主屏幕内的屏幕上。。我会在一秒钟内更新我的答案
<td data-title="'Licences'">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Endorsement</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="licence in pilot.licences">
<td ignore-cell="true">{{licence}}</td>
</tr>
</tbody>
</table>
</td>