0

I am learning angularjs with bootstrap, I am displaying data in table now it has many columns and hence data overflows and can be seen by scrolling the page to right, but this means that complete page needs to scrolled i need only the table component to be scrollable instead of the complete page. How can i achieve that ?

i have given overflow-x as scroll but still the complete page is scrolled instead of just table

table ng-table="tableParams" show-filter="true" class="table table-striped" style="overflow-x: scroll">
Ambuj Jauhari
  • 1,187
  • 4
  • 26
  • 46

3 Answers3

3

Define style in table property like this:

style="overflow-x: auto; width:200px; height: 389px;"

Deepanjan
  • 649
  • 2
  • 8
  • 15
1

Set a size for the table (e.g. use 100vh for full page-height), then apply

overflow: scroll;

to your table, and the element should scroll independently.

0

You have to create another div around your table with class of table-responsive.

<div class="table-responsive">
  <div class="table table-striped">
    Your table
  </div>
</div>

Responsive tables

max
  • 8,632
  • 3
  • 21
  • 55