scrollX not working for my data table
scrollX not working for my data table
datatestlord
Posts: 6Questions: 3Answers: 1
"success": function(json) {
var tableHeaders;
$.each(json.columns, function(i, val){
tableHeaders += "<th>" + val + "</th>";
});
$("#dataTable").empty();
$("#dataTable").append('<thead><tr>' + tableHeaders + '</tr></thead>');
![](https://datatables.net/forums/uploads/editor/y0/45twvaoq6vu9.png "")
var dataSet = json.data;
var table = $('#dataTable').DataTable({
'responsive': true,
"sScrollX": "100%",
"bScrollCollapse": true,
'scrollY': '350px',
'data':dataSet,
'columnDefs': [{
"targets": 13,
"data": null,
"defaultContent": "<button ><img src='image/phone-icon.png' style='height:20px; width:20px'></button>"
}],
'order': [0, 'asc']
});
This discussion has been closed.
Answers
Thanks for your question. As noted in the forum rules, please post a link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Allan