title: How to to display array of objects of array in *ngfor
body: <p>I have an array like this</p>
  <pre><code> tdata = {
      jam: [1, 2, 4, 5],
      ram: [11, 12, 34, 14],
      sam: [21, 22, 23, 24],
      jug: [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;d&quot;],
      tam: [31, 32, 33, 34]
    };
  </code></pre>
  <p>`
  I want to print/display object keys like jam, ram, sam as table headers and their values in the respective table in angular with Pprimeng table. I tried various ways but unable to display correctly.
  Primeng table for dynamic values</p>
  <pre><code>&lt;p-table [columns]=&quot;cols&quot; [value]=&quot;products&quot;&gt;
      &lt;ng-template pTemplate=&quot;header&quot; let-columns&gt;
          &lt;tr&gt;
              &lt;th *ngFor=&quot;let col of columns&quot;&gt;
                  {{col.header}}
              &lt;/th&gt;
          &lt;/tr&gt;
      &lt;/ng-template&gt;
      &lt;ng-template pTemplate=&quot;body&quot; let-rowData let-columns=&quot;columns&quot;&gt;
          &lt;tr&gt;
              &lt;td *ngFor=&quot;let col of columns&quot;&gt;
                  {{rowData[col.field]}}
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/ng-template&gt;
  &lt;/p-table&gt;
  </code></pre>
  <p>If I want to display I need the array to be automatically in the form</p>
  <pre><code>tdata = [
          {jam:1,ram:11,sam:21,jug:&quot;a&quot;,tam:31},
          {jam:2,ram:12,sam:22,jug:&quot;b&quot;,tam:32},
          {jam:3,ram:34,sam:23,jug:&quot;c&quot;,tam:33},
          {jam:5,ram:14,sam:24,jug:&quot;d&quot;,tam:34 }
        ]
  </code></pre>
  <p>Values In the tdata may change dynamically they come from the backend and key also</p>