【发布时间】:2018-11-06 08:15:53
【问题描述】:
如果所有条件都满足且为真,则所有列都匹配并显示在数据表中,如:
client.auditorGroup 为真或假。工作代码是:
<table class="table table-bodered">
<thead>
<tr>
<th>Mag No</th>
<th>SelectionDate</th>
<th> SelectedBy</th>
<th>PanEximNumber</th>
<th>Name</th>
<th>Address</th>
<th>PhoneNumber</th>
<th>SelectionType</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let client of clients" (click)="onClick(client)">
<td [ngStyle]="getStyle(this.client)">{{client.selectionId}}</td>
<td>{{client.selectionDate}}</td>
<td>{{client.selectedBy}}</td>
<td>{{client.panEximNumber}}</td>
<td>{{client.name}}</td>
<td>{{client.address}}</td>
<td>{{client.phoneNumber}}</td>
<td>{{client.selectionType}}</td>
<td *ngIf="!client.auditorGroup" [ngStyle]="getStyle(this.client)">Edit
Delete</td>
</tr>
</tbody>
</table>
在最后一个条件下,如果它是假的,那么由于这个语句,数据表变得像列不匹配:
<td *ngIf="!client.auditorGroup" [ngStyle]="getStyle(this.client)">Edit
Delete</td>
【问题讨论】:
-
cl 作为一种解决方法,为什么不根据
client.auditorGroup值在末尾显示空白td -
你能澄清一下预期的行为吗?
-
你能解决这个问题吗?
标签: javascript angular datatable angular6