Trouble with sScrollY
Trouble with sScrollY
Have a DataTable in a div
Desired:
1. div to have a max-height H
2. If DataTable has enough rows to reach max-height, should scroll vertically the rows but not the header.
3. If DataTables has fewer rows, should not scroll and div should shrink to fit.
If I make sScrollY fixed S, e.g., 28em or 250px, and div has height H (not max-height, and SH, then DataTable scrolls like I want if it has enough rows, but when it doesn't, there is all the empty space in the div.
If I make sScrollY relative ( % ), and div has max_height, then div always has scrollbar instead of DataTable. Which means rows and headers both scroll, headers disappearing off top edge of div.
Tried several combinations, but never got better than any of that (and in one combination, it was worse: div and DataTable each had their own scroll bar).
Desired:
1. div to have a max-height H
2. If DataTable has enough rows to reach max-height, should scroll vertically the rows but not the header.
3. If DataTables has fewer rows, should not scroll and div should shrink to fit.
If I make sScrollY fixed S, e.g., 28em or 250px, and div has height H (not max-height, and SH, then DataTable scrolls like I want if it has enough rows, but when it doesn't, there is all the empty space in the div.
If I make sScrollY relative ( % ), and div has max_height, then div always has scrollbar instead of DataTable. Which means rows and headers both scroll, headers disappearing off top edge of div.
Tried several combinations, but never got better than any of that (and in one combination, it was worse: div and DataTable each had their own scroll bar).
This discussion has been closed.
Replies
Allan