Angular4添加了第二个Tbody元素



我想在几个表中表示一些数据。但是Angular 4向其中添加了许多新的divs,也是一个破坏我桌子的新Tbody。

她的模板:

<div *ngFor= "let table of qmc.simplificationTable; let myIndex = index">
    <table class="table table-bordered col-md-4">
      <thead>
        <tr>
          <th>Group</th>
          <th>Vars</th>
          <th>Benutzt</th>
        </tr>
      </thead>
      <tbody>
        <div *ngFor= "let group of table let groupIndex = index">
          <div *ngFor= "let primeImplicant of group">
            <tr>
              <td>
                {{groupIndex}}
              </td>
              <td>
                {{primeImplicant.toString()}}
              </td>
              <td>
                {{primeImplicant._usedForCombination}}
              </td>
            </tr>
          </div>
        </div>
      </tbody>
    </table>
  </div>

这是HTML结果:https://pastebin.com/z5uneymf

您可以看到Angular4向每个

添加了一个新的tbody元素
<tr>

这些tbodies和新的Divs摧毁了我的桌子。

如何解决此问题?

只需替换

<div *ngFor

<ng-container *ngFor

感谢Yurzui(Yurzui的想法在评论中(

最新更新