Datatable header displayed twice when "scrollX": true datatable function.
Datatable header displayed twice when "scrollX": true datatable function.
I am facing issues, the Sorting icon in data table displayed twice while using the Horizontal scroll bar (scrollX).
If I removed the scrollX this it works fine.
This is my table :
Delivery Organization | Client Name | Project Name | Busniess Unit | Sub Busniess Unit | Demand Owner | Account ASE | Month 1 | Month 2 | Month 3 | Month 4 | Month 5 | Month 6 | Month 7 | Month 8 | Month 9 | Month 10 | Month 11 | Month 12 | Month 13 | Month 14 | Month 15 | Month 16 | Month 17 | Month 18 |
---|
CSS:
th, td { white-space: nowrap; }
.dataTables_wrapper .dataTables_filter {
margin-top: 0.5em;
}
Javascript:
$(document).ready(function() {
var table = $('#example').dataTable( {
"scrollX": true
} );
} );
I am using bootstrap framework, in the data table the sorting icon displayed twice.
Answers
add below code when datatables() function
"fnInitComplete": function() {
$("tfoot").next().hide();
},
"fnDrawCallback": function( oSettings ) {
$("tfoot").next().hide();
}