ScrollX does not work in Angular
ScrollX does not work in Angular
![johnnyatt](https://secure.gravatar.com/avatar/8d7408b1ea9dfaf3f54bd40405346912/?default=https%3A%2F%2Fvanillicon.com%2F8d7408b1ea9dfaf3f54bd40405346912_200.png&rating=g&size=120)
Hello,
I am trying to use datatable in angular 6 and was able to configure scrolly, but I am having a challenge with scrollx.
here is my dtoption set up and tables.
from component.ts
this.dtOptions = {
pagingType: 'full_numbers',
pageLength: 10,
scrollX: true,
scrollY: '500',
};
from html
<
table datatable [dtOptions]="dtOptions" [dtTrigger]="dtTrigger" class="display nowrap" style="width:100%">
Thanks.
This question has accepted answers - jump to:
This discussion has been closed.
Answers
What does not work?
Does the scroll bar not appear or not scroll?
Maybe you can post a screenshot of the issue.
Kevin
Sorry, so I have 20 columns, the table populates long width of table with vertical scroll bar but, horizontal scroll bar does not appear at all![:( :(](https://datatables.net/forums/resources/emoji/frowning.png)
![](https://datatables.net/forums/uploads/editor/3l/ll0wjsyyqxbx.png)
@kthorngren
Hey Kevin, will you be able to assist me.
I will be really appreciate for your help and effort.
Thanks!
Just a guess since you have posted much about the rest of the page but it looks like there is a scrollbar at the bottom of the screenshot. Maybe the
div
the table is in is scrolling which might keep scrollX from activating. Something like this example withoverflow:auto;
maybe?http://live.datatables.net/zukudona/1/edit
Kevin
My example was incorrect. I had scrollX disabled. The updated example does work:
http://live.datatables.net/yazalaze/1/edit
Can you post a link to your page are a test case showing the issue? The problem is something in your environment causing scrollX to not activate.
Kevin
https://datatables.net/reference/option/scrollX
use "nowrap" class