Dynamic Columns
Dynamic Columns

Hello!
In my web page I need to display a table with dynamic data like this example:
var colors = [
{ Color: "Red", Price: 10 },
{ Color: "Blue", Price: 8.5 },
{ Color: "Green", Price: 9 }
];
The data length in the list can vary, what I want to do is display a six column table with all the data contained in the object like this:
| Red | 10 | Blue | 8.5 | Green | 9 |
Some idea?
Thanks for your help
Regards
This discussion has been closed.
Answers
This is not something that DataTables currently supports. Each element in the array represents a row, so you would need to transform the array to match that requirement if you wanted to use DataTables.
Allan