Reputation: 614
I have a controller as PostsController
and an Ajax which gets JSON data from the PostsController
and I am able to show that JSON data in the table in blade view, but problem is I have to statically declare the table column name and I want to make the table column name and field defined dynamically according to received JSON data.
The structure of the data is as follows:
[
'title': 'stackoverflow is awesome',
'body': 'stackoverflow is the top community for developers'
]
Now here I am trying to generate table column names and show these incoming data. What I am doing right now is just generating column rows like this:
I would really appreciate any help.
Upvotes: 1
Views: 386
Reputation: 144
Please have a look at this answer, I think it is the same as what you are trying to do.
Upvotes: 2