I have an array with the following structure.
0: "ID,NAME,NUMBER,DESCRIPTION" 1: "123,"PHILIP",0123456789,"OFFICE ADDRESS" 2: "456,"SARA",30345004698,"OFFICE SPACE""
I need to display it in a table. The table header will be the 0th row and remaining rows will be the table body rows (tr). Please help me to achieve this.
I can display the table header but table body is not coming properly.
Table is displaying like below 
Please find below my code
tableArray: any;
tableArrayRows: any[] = [];
tableHeader: any;
tableRows: any[] = [];
//Splitting the array at new line
this.tableArray = this.detailsArray.split(/\r?\n/);
//Table header row
this.tableHeader = this.tableArray[0].split(',');
//Table body row
for(var i = 1; i < this.tableArray.length; i ++){
this.tableArrayRows.push(this.tableArray[i]);
this.tableRows = this.tableArrayRows.split(',');
}
<table class="table table-striped table-bordered">
<thead>
<tr>
<th *ngFor="let tableHeaders of tableHeader">{{tableHeaders}}</th>
</tr>
</thead>
<tbody>
<tr>
<td *ngFor="let tableRows of tableRows">{{ tableRows }}</td>
</tr>
</tbody>
</table>