Dynamic Columns

Dynamic Columns

mmuniz185xmmuniz185x Posts: 1Questions: 1Answers: 0

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

Answers

  • allanallan Posts: 63,679Questions: 1Answers: 10,498 Site admin

    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

This discussion has been closed.