Reputation: 31
I am using Angular data table and I want to apply horizontal scrollbar. Previously I used jQuery data-tables, its quite easy in jQuery but I didn't find same for Angular data-tables.
Upvotes: 0
Views: 1373
Reputation: 22
Use the following configurations in your typescript and html template file respectively
dtOptions: any = {};
ngOnInit() {
this.dtOptions = {
// other configurations
scrollX: true,
}
<table datatable [dtOptions]="dtOptions"></table>
Upvotes: 0
Reputation: 31
Its quite easy with Angular data-tables. Simply add 'dtOptions' to your table. and configure same as follows $scope.dtOptions = DTOptionsBuilder.newOptions().withOption('scrollX', '100%');
Upvotes: 1