I am using DataTables plugin with Responsive Table and fixed yScroll and disabling xScroll.
But I am still getting the Horizontal Scrollbar, though I am adding the code like below...
scrollY: 200,
scrollX: false,
Anyhow, I am using Responsive table, why I want to show the Horizontal Scrollbar?
Because of this, Expand / Collapse on Columns functionality also not working...
Please refer the code, online example and screenshot below...
Online Demo
CSS
th,td{white-space:nowrap;}
If I remove above css it is working as expected. But I dont want to wrap down the td / th text. This is where I am facing problem :(
jQuery:
$(document).ready(function() {
var table = $('#example').DataTable( {
dom: 'RCT<"clear">lfrtip',
scrollY: 200,
scrollX: false,
columnDefs: [
{ visible: false, targets: 1 }
],
"tableTools": {
"sRowSelect": "multi",
"aButtons": [
{
"sExtends": "print",
"sButtonText": "Print"
}
]
}
});
});
HTML
<table id="example" class="display responsive" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tbody>
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
</tr>
.....................

th,td{white-space:nowrap;}to get rid of horizontal scrolbar.https://www.datatables.netwhere access would be blocked, use//cdn.datatables.netinstead.body{margin:50px;max-width:700px;}tobody{margin:50px;max-width:900px;}?