question about scrollResize plug-in

question about scrollResize plug-in

Pierce KrousePierce Krouse Posts: 40Questions: 8Answers: 1

In a discussion about scrolling data located here:
http://datatables.net/forums/discussion/comment/87518
Allan mentioned his scrollResize plug-in, located here:
https://github.com/DataTables/Plugins/tree/master/features/scrollResize
that might do what I need.

I downloaded the plugin example and started working with it a bit, and see that it relies on

height: 97vh;

to resize the scrollable area. I can wrap my table in the div structure your example shows without any problem.

However, my pages have some boilerplate at the top that is constant in height (and one section whose height will not change for the duration of the table's view). The page height itself can also be captured, of course.

My only question is, can this plug-in's height be controlled by some style that is not a percentage of the page height? Is there even a way to specify a height as "everything except this much"?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    see that it relies on

    It doesn't - that was just an example. You could use 100% etc.

    The key thing is that you need to put the DataTable in a container element which itself is correct for the height. That's why I mentioned position:absolute in the other thread as I think that would be useful in your case. For example:

    div.container {
      position: absolute;
      top: 100px;
      left: 10px;
      right: 10px;
      bottom: 10px;
    }
    

    Allan

This discussion has been closed.