JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" href="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css">
<table id="allwl">
<th class="hidden-480">Price</th>
<th class="hidden-480">Volume</th>
<th class="hidden-480">Quantity</th>
</table>
JavaScript
var dataSet =
[
[
"1441.75",
"238"
],
[
"1614.45",
"3273"
],
[
"834.15",
"1586"
]
];
var array_names = ["A", "B", "C"];
for(var key in dataSet) {
if(dataSet.hasOwnProperty(key)) {
//dataSet[key].unshift(array_names[key]);
dataSet[key].splice(0,0,array_names[key]);
}
}
$(function() {
$('#allwl').dataTable( {
"iDisplayLength": -1,
"data": dataSet,
"columns": [
{ "title": "Name" },
{ "title": "Price" },
{ "title": "Quantity" ,
mRender: function(data, type, row){
var quantity = row[2] ;
return quantity;
}
}
]
});
})