title: How to get first td value of tr on click in prime ng table
body: <p>How to get first td value of tr on click condition.If i click the first td i want to get the value in angular 7.Please do not write any inline code for tr. We need to Use only by coding like find table inside .How we can do it using p-table id="dt" by viedchild or element reference?</p>
  
  <p>Demo: <a href="https://stackblitz.com/edit/p-table-primeng-v6-t1k6ng?file=src/app/app.component.html" rel="nofollow noreferrer">https://stackblitz.com/edit/p-table-primeng-v6-t1k6ng?file=src/app/app.component.html</a></p>
  
  <p>app.component.ts:</p>
  
  <pre><code>@ViewChild('dt') public dataTable: DataTable;
  </code></pre>
  
  <p>app.component.html:</p>
  
  <pre><code>&lt;p-table id="dt" [columns]="cols" [value]="cars" [scrollable]="true" [rows]="10"  [virtualRowHeight]="30" [loading]="loading"
      [virtualScroll]="true" (onLazyLoad)="loadCarsLazy($event)" [lazy]="true" [totalRecords]="totalRecords"&gt;
  
      &lt;ng-template pTemplate="header" let-columns&gt;
          &lt;tr&gt;
              &lt;th *ngFor="let col of cols"&gt;
                  {{col.header}} 
              &lt;/th&gt;
          &lt;/tr&gt;
      &lt;/ng-template&gt;
      &lt;ng-template pTemplate="body" let-rowData let-columns="columns"&gt;
          &lt;tr style="height:30px"&gt;
              &lt;td *ngFor="let col of cols"&gt;
                  {{rowData[col.field]}}
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/ng-template&gt;
  &lt;/p-table&gt; 
  </code></pre>
  
  <p>Note:
  please do not write like this inline code: Do it by typescript or javascript.</p>
  
  <pre><code>&lt;ng-container *ngFor="let col of cols; let i = index;"&gt;
    &lt;td (click)="handleClick(i)"&gt;
       {{rowData[col.field]}} 
    &lt;/td&gt;
  &lt;/ng-container&gt;
  </code></pre>