1

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:

enter image description here

I would really appreciate any help.

1 Answer 1

2

Please have a look at this answer, I think it is the same as what you are trying to do.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.