Is there a way to implement horizontal and vertival scroll to a pageblocktable similar to the ones in ListViews?
Similar to ListViews means vertical scrolling is only for the data and not for header and header and body share the same horizontal scrolling .
I tried;
<script>
var idx = "{!$Component.myPb.displayTable}";
idx = idx +':tb'; // Get the body of page block table
document.getElementById(idx).style = "overflow:auto;height: 250px;";
</script>
But it is not helping.
Update: I tried the StickyTableHeader mentioned in Eric's Answer which is working great but only problem is if overflowing horizontally it miss-aligns the header and body