How to put multiple data in a datatable column?
How to put multiple data in a datatable column?
My JSON is as follows:
[code]
[{"name": "John Doe", "email": "john@gmail.com", "address" : "blah"}] [/code]
In Datatables I can easily show these 3 pieces of info in 3 diff columns using the following:
[code]
columnDefs = [
{ "mData": "name", "aTargets":[0] },
{ "mData": "email", "aTargets":[1] },
{ "mData": "address", "aTargets":[2] }
];
[/code]
But the problem is that I want to show "name" and "email" in 1st column and then "address" in the 2nd column. How can I do that? Please guide.
[code]
[{"name": "John Doe", "email": "john@gmail.com", "address" : "blah"}] [/code]
In Datatables I can easily show these 3 pieces of info in 3 diff columns using the following:
[code]
columnDefs = [
{ "mData": "name", "aTargets":[0] },
{ "mData": "email", "aTargets":[1] },
{ "mData": "address", "aTargets":[2] }
];
[/code]
But the problem is that I want to show "name" and "email" in 1st column and then "address" in the 2nd column. How can I do that? Please guide.
This discussion has been closed.
Replies
Allan