1

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 Answers 3

3

I should call as follows to provide horizontal scrollbar:

$scope.dtOptions = DTOptionsBuilder.newOptions().withOption('scrollX', '100%');
Sign up to request clarification or add additional context in comments.

1 Comment

using .withOption('scrollX', '100%'); causes table header distorted
1
DTOptionsBuilder.newOptions()
.withOption('responsive', true)
.withOption('scrollX', 'auto')      
.withOption('scrollCollapse', true)
.withOption('autoWidth', false);

will fix the header issue.

1 Comment

Thanks. this is really working with responsive tables
1

Very Simple:

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.