I am creating one table with pure HTML code (i.e. without any 3rd party library or bootstrap) Here is my code : https://stackblitz.com/edit/angular-ivy-rilymn?file=src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fapp.component.css
I want table structure like this : (not talking about CSS,, HTML structure) enter image description here
but the o/p is not as expected.
Any help would be appreciated!
You have 2 mistakes in your HTML hierarchy.
div
. Try to change this to ng-container
in order to not add additional nodes in your DOM, like <ng-container *ngFor="let nameDatas of getMarksData">
....
<tr>
<td>
<tr *ngFor="let jj of nameDatas.subMarkData">
...
Try to just remove the tr
and td
node and you should be fine.