Show key as value in datatable.
Show key as value in datatable.

var my_data = {
"contents": [
{
"data_v1": [{"id" : 1}]
},
{
"data_v2": [{"id" : 2}]
},
{
"data_v3": [{"id" : 3}]
}
]
};
$(document).ready(function() {
$('#example').DataTable( {
data:my_data,
columns: [
{ data: 'contents' }
]
} );
} );
Hello, can anyone help me. I have datasource and I want to show in the table the key as value. How to do that?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I want this as result. Thankyou
You can do something like this,
Colin