The height given to the virtual scroll is 500px.
Mat table vertical scroll.
Many times in application development we are faced with situations wherein we need to present a huge volume of data be it live feeds or a huge amount of master transaction data.
This simple tricks to solve the problem of making table body scroll able with fixed table headers.
The css related to the virtual scroll module is as follows table width.
What is the current behavior.
This makes the data table easier to use.
Right now adding a scroll to mat table adds an overflow starting from the header row level.
Scrolling functionality works vertically y axis and horizontally x axis.
If the screen size gets smaller an horizontal scroll bar shows automatically to allow the table to scroll.
Now i need to turn the table vertical scroll into a table with a fixed header and with a body scrolling vertically.
Fixed table header when user scroll provides the context.
Cdk virtual scroll viewport height.
Resize the browser window to see the effect.
Angular bootstrap table scroll bootstrap 4 material design for the tables with a huge amount of data you can use scroll functionality as an alternative for the pagination.
We are done with adding the necessary code to get our virtual scroll module to be viewed.
Ensure you import all the essential segments in the app module ts and have made the key table.
Instead you ll want to set your own styling to the table such that the min width matches the total min width of the cells.
The images that fit within that height will be displayed to the user.
I used html and the following css to get this output.
A responsive table will display a horizontal scroll bar if the screen is too small to display the full content.
Scroll should start from mat rows tbody and not mat header rows thead.