Datatables on-the-fly resizing

后端 未结 12 2219
灰色年华
灰色年华 2020-12-12 16:21

I\'m using the marvellous DataTables jQuery plug-in; http://datatables.net/ Added the FixedColumns and KeyTable extras.

Now the table does resize prettily when the

12条回答
  •  猫巷女王i
    2020-12-12 16:55

    I know this is old, but I just solved it with this:

      var update_size = function() {
        $(oTable).css({ width: $(oTable).parent().width() });
        oTable.fnAdjustColumnSizing();  
      }
    
      $(window).resize(function() {
        clearTimeout(window.refresh_size);
        window.refresh_size = setTimeout(function() { update_size(); }, 250);
      });
    

    Note: This answer applies to DataTables 1.9

提交回复
热议问题