【发布时间】:2020-07-17 16:30:13
【问题描述】:
我正在使用带有 Angular 和 Metronic (https://preview.keenthemes.com/metronic/demo1/index.html) 的项目,我需要将一些信息放在表格中,这些信息是以空格开头的单词,我需要打印这些空格,但是表中的文字做了修饰。
这是我的代码:
<table style="width:100%" class="table table-striped table-hover table-sm" [mfData]="list" #mf="mfDataTable">
<thead>
<tr class="bg-primary text-light">
<th style="width: 10%"><mfDefaultSorter by="code">Code<i class="fa fa-sort"></i></mfDefaultSorter></th>
<th style="width: 30%"><mfDefaultSorter by="desc">Desc<i class="fa fa-sort"></i></mfDefaultSorter></th>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of mf.data | filterBy:['code', 'desc']:filterText; let i = index">
<td>{{ item.code }}</td>
<td>{{ item.desc }}</td>
</tr>
</tbody>
</table>
结果或多或少是这样的:
【问题讨论】: