【发布时间】:2018-01-20 02:41:57
【问题描述】:
我有一个数组:
let headers = [
{ title: 'First Name', style: 'bold' },
{ title: 'Last Name', style: 'bold' },
{ title: 'Book', style: 'bold', titleSecond: 'All/Remainder', style2:'not bold' },
{ title: 'City', style: 'not bold', titleSecond: 'Street', style2: 'not bold' }
];
我正在遍历简单的 HTML 表格:
<table>
<thead>
<tr>
<th *ngFor="let header headers">
{{ header.title }}
</th>
</tr>
</thead>
</table>
是否可以让表头看起来像这样:
是否可以为表头创建一些模板?我可以更改我的对象,因为我想更改此 headers 对象。
【问题讨论】:
-
它有什么问题?为什么你的第四个对象有重复的属性
style? -
@yurzui 哎呀,对不起,我编辑了一个对象。
标签: javascript html angular html-table