Datatables theme without horizontal scroll
- Single Page
Posted 16 July 2012 - 17:52 PM
Recently I made a grid from a large database table with 24 columns. Unexpectedly I noticed that grid doesn't have a horizontal scroll bar. The columns prolonging after the content of my page. Let me show you the issue:
[img]https://lh6.googleusercontent.com/-__L2MUsGyUs/UARUhfj2GUI/AAAAAAAAANk/N4g3gEU6W_A/s989/Screenshot+from+2012-07-15+20%3A55%3A36.png[/img]
Any solution to fix it?
Posted 17 July 2012 - 06:48 AM
You can simply add this CSS style:
.dataTables_wrapper {
overflow: auto;
}
and you will have a great scroll bar at overflow.
Posted 05 December 2012 - 18:54 PM
The best way to handle this is to simply destory the initial initialisation and use your own so that you can set this property.
var oTable2 = $('#groceryCrudTable').dataTable({"bDestroy":true,"sScrollX": "100%",
"sScrollXInner": "150%",
"bScrollCollapse": true});
If you download the Fixed Column plugin http://datatables.net/extras/
you can also make your first and last (or whatever) columns static - useful for keeping names and action buttons showing.
new FixedColumns( oTable, {
"iLeftColumns": 1,
"iRightColumns": 1
} );
Posted 01 December 2015 - 15:40 PM
Can one send instructions on how and where to implement the scroll bar code
Posted 23 February 2016 - 10:21 AM
Sorry for revive this post, but I need a solution for this, I tried Matt's solution but it didn't work for me or I didn't understand it.
Thank you
Posted 24 February 2016 - 19:55 PM
Sorry for revive this post, but I need a solution for this, I tried Matt's solution but it didn't work for me or I didn't understand it.
Thank you
Hello, you need to add to the css file the next code.
.dataTables_wrapper { overflow: auto; }
If you are use the datatable theme go to assets/grocery_crud/themes/datatables/css/datatables.css and add the code.
Posted 25 February 2016 - 08:53 AM
Hello, you need to add to the css file the next code.
.dataTables_wrapper { overflow: auto; }If you are use the datatable theme go to assets/grocery_crud/themes/datatables/css/datatables.css and add the code.
I saw this solution in the forum, but it is a poor solution. Thanks but I will not use this ^^', I think I will buy bootstrap theme....