<tbody>
<tr *ngFor="let person of check">
<td>{{ person }}</td>
</tr>
<tr *ngFor="let person of check2">
<td>{{ person }}</td>
</tr>
我该怎么做才能将这两个列保存在两个不同的列中
答案 0 :(得分:1)
由于tr
是&#34;行&#34;你只需要将它们放在同一个tr
。
而且,如果您需要在这两个标签中使用*ngFor
标签,我建议您将它们放在td
s上:
table td {
border: 1px solid black;
}
&#13;
<table>
<tbody>
<tr>
<td *ngFor="let person of check">{{ person }}</td>
<td *ngFor="let person of check2">{{ person }}</td>
</tr>
</tbody>
</table>
&#13;
希望它有所帮助。