I am trying to arrange the data from a JSON in a table with the following structure displayed in a single row. Can someone assist me in looping through the JSON to rearrange the items as specified below?
StudentId | CourseTitle | TextbookName
23 | Biology | Biology Today
JSON Data Format:
{
"studentId": 23,
"course": [{
"courseTitle": "Biology",
"textBook": 1,
"TextBooks": {
"textbookId": 1,
"textbookName": "Biology Today"
}
}, ... ]
}
Sample Code:
<table class="table">
<tbody>
<tr *ngFor="let student of this.listOfStudents">
<td >{{student ?.studentId}}</td>
</tr>
</tbody>
</table>