Multidimensional array to datatable
Multidimensional array to datatable
![shi_ro](https://secure.gravatar.com/avatar/8c60f5f18c6fc8f35796167e3071fdda/?default=https%3A%2F%2Fvanillicon.com%2F8c60f5f18c6fc8f35796167e3071fdda_200.png&rating=g&size=120)
I have a html table which looks like this
I would like to convert it to a datatable , so that i can easily implement filters. But i have been having challenges because my dataset looks like this. Is there support for such a data structure?:
array(
'items' => array (
'2020-08-04' => array (
0 => array (
0 => array (
'payment_name' =>'Cash',
'amount_paid' => "0"
),
),
1 => 0,
),
'2020-08-05' => array (
0 => array(
0 => array (
'payment_name' => 'Cash',
'amount_paid' => "0"
),
1 => array (
'payment_name' => 'Mpesa',
'amount_paid' => "165"
),
),
1 => 165,
),
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
It would be easier to understand your requirements if your HTML table showed column headings and your array data was the same as your HTML data.
@tangerine This is my table with headings
![](https://datatables.net/forums/uploads/editor/tt/3h7bbuyazbhm.png)
Also i am using server side processing
Not a lot of time but look at rowGroup
https://datatables.net/extensions/rowgroup/examples/initialisation/simple.html