我如何将这2个放在2个不同的列中

时间:2018-05-12 18:41:31

标签: html

<tbody>
 <tr *ngFor="let person of check">
     <td>{{ person }}</td>
 </tr>
 <tr *ngFor="let person of check2">
      <td>{{ person }}</td>
  </tr>

我该怎么做才能将这两个列保存在两个不同的列中

1 个答案:

答案 0 :(得分:1)

由于tr是&#34;行&#34;你只需要将它们放在同一个tr

而且,如果您需要在这两个标签中使用*ngFor标签,我建议您将它们放在td s上:

&#13;
&#13;
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;
&#13;
&#13;

希望它有所帮助。