Whats the best way to set height of datatables dynamically on window.resize?

Whats the best way to set height of datatables dynamically on window.resize?

bbaranibbarani Posts: 32Questions: 0Answers: 0
edited January 2013 in DataTables 1.9
I have multiple tabs in my application with multiple datatables.

I am trying to figure out a way to adjust the height of datatables based on the screen size.

I tried the below function, but it doesnt seem to increase the height of datatable when the window is resized. Any suggestions would be very helpful?

$(window).resize(function() {
var table = $.fn.dataTable.fnTables(true);
if ( table.length > 0 ) {
for(var i=0;i

Replies

  • bbaranibbarani Posts: 32Questions: 0Answers: 0
    I figured out a way to increase the height using scrollY parameter...

    $(window).resize(function() {
    var table = $.fn.dataTable.fnTables(true);
    if ( table.length > 0 ) {
    for(var i=0;i
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    There is no nice easy built in way of doing it yet, but this is one method I've used in the past: http://live.datatables.net/uvinax/edit#preview

    Allan
This discussion has been closed.