horizontal scrollbar issue for angular dataTables

4.4k views Asked by At

I am using angular dataTable where I need to provide horizontal scrollbar.

I used the following code to provide option to get horizontal Scrollbar.

$scope.dtOptions = DTOptionsBuilder.newOptions().withDOM('scrollX', '100%');

But its not working. I didnt find any documentation to get horizontal scroll. Can anyone know about it.

3

There are 3 answers

1
user1268130 On BEST ANSWER

I should call as follows to provide horizontal scrollbar:

$scope.dtOptions = DTOptionsBuilder.newOptions().withOption('scrollX', '100%');
1
vbYadav On
DTOptionsBuilder.newOptions()
.withOption('responsive', true)
.withOption('scrollX', 'auto')      
.withOption('scrollCollapse', true)
.withOption('autoWidth', false);

will fix the header issue.

0
sam ruben On

Very Simple:

DTOptionsBuilder.newOptions()
.withOption("scrollX", true)