dynamically size the table in larger monitors?

dynamically size the table in larger monitors?

westjohn1234westjohn1234 Posts: 15Questions: 0Answers: 0
edited July 2012 in General
Can we dynamically size the table such that it takes more advantage of our screen real estate on bigger monitors? Right now it is a fixed height... I would like to stretch it so that it fits more of the screen on larger monitors.

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    Are you using paging? Scrolling? Something else? The answer is yes, but it depends upon how you are using the table. I think this might be a good one for an example in future, as vertical size resizing does crop up on the forums quite a few times. Note made :-)

    Allan
  • westjohn1234westjohn1234 Posts: 15Questions: 0Answers: 0
    Hi Allan,

    Thanks for the quick response. We are using scrolling, in fact we have implemented like http://datatables.net/release-datatables/extras/Scroller/large_js_source.html. When we see this in bigger monitors, we find lots of empty space at the bottom. Can we get rid of this by adjusting the table height dynamically?

    West
  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    You can set the sScrollY parameter on initialisation using something like:

    [code]
    sScrollY: $(window).height() - 100
    [/code]

    The problem there is that it doesn't cope with resizing. You would need to dynamically modify the container to have that work. I will try to set up an example when I get a chance.

    Allan
  • westjohn1234westjohn1234 Posts: 15Questions: 0Answers: 0
    Thanks allan.. It works nicely..



    West
This discussion has been closed.