Angular4 add second tbody element

I want to present some data in several tables. But Angular 4 is adding a lot of new divs to it and also a new one of yours which is destroying my table.

Her template:

<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>

      

this is the html result: https://pastebin.com/z5UneyMf

You can see that angular4 is adding a new tbody element to each

<tr>

      

These tweets and new divs are destroying my table.

How can I solve this?

+3


source to share


1 answer


Just replace

<div *ngFor

from



<ng-container *ngFor

      

Thanks to yurzui (yurzui's idea in the comments)

0


source







All Articles