应用ngfor时打破html td

时间:2018-06-03 10:51:36

标签: html angular

<table>
<tr>
<th>Date</th>
<th>Products</th>
</tr>
<tr *ngFor="let x of orderdetails">
<td>{{x.orderdate}}</td>
<td *ngFor="let y of x.orderproducts">
  <span class="break">{{y}}</span><br>
</td>
</tr>
</table>

如何打破td中给出span的行,     CSS     。打破{     自动换行:打破字;     空白:预缠绕;     } 皇家阿斯皮拉应该放在皇家原子下面 enter image description here

1 个答案:

答案 0 :(得分:1)

试试这个

<table>
  <tr>
    <th>Date</th>
    <th>Products</th>
  </tr>
  <tr *ngFor="let x of orderdetails">
    <td>{{x.orderdate}}</td>
    <td>
      <div *ngFor="let y of x.orderproducts">
          <span class="break">{{y}}</span>
      </div>
      <br>
    </td>
  </tr>
</table>