Primeng make scrollable datatable height responsive

I use this at p-table (not sure if will work on p-datatable).

[scrollHeight]="'calc(100vh - 204px)'"


I don't know if this fits exactly your case, but I solved my issue by setting the scrollHeight datatable property to:

scrollHeight="50vh"

vh refers to:

vh Relative to 1% of the height of the viewport

Viewport = the browser window size. If the viewport is 50cm wide, 1vw = 0.5cm.

You can test different values of the vh and see what fits better.

more on: https://www.w3schools.com/cssref/css_units.asp