Rakshit
Published in : 2022-03-06
I want to make my columns as rows and rows as columns in the table view. How can I do that?
My data is given below;
data = [{id: 1,name: 'Rakshit',age: 18salary: $15/hr},{id: 2,name: 'Ashish',age: 19salary: $18/hr},{id: 3,name: 'Pragnesh',age: 18salary: $20/hr}];
Using *ngFor I am able to make a table looks like below,
ID | Name | Age | Salary1 | Rakshit | 18 | $15/hr2 | Ashish | 19 | $18/hr3 | Pragnesh| 18 | $20/hr
I want to change columns to row, my expected output should be,
ID | 1 | 2 | 3Name | Rakshit | Ashish | PragneshAge | 18 | 19 | 18Salary | $15/hr | $18/hr | $20/hr
How do I loop it to get above results?
Ref: //blog.angular-university.io/angular-2-ngfor/
There is no comments yet
Join our community and get the chance to solve your code issues & share your opinion with us
Sign up Now