我正在使用 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>
Run Code Online (Sandbox Code Playgroud)
结果或多或少是这样的: