Datatables on-the-fly resizing

后端 未结 12 2195
灰色年华
灰色年华 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条回答
  •  南方客
    南方客 (楼主)
    2020-12-12 16:43

    $(document).ready(function() {
        $('a[data-toggle="tab"]').on( 'shown.bs.tab', function (e) {
            // var target = $(e.target).attr("href"); // activated tab
            // alert (target);
            $($.fn.dataTable.tables( true ) ).css('width', '100%');
            $($.fn.dataTable.tables( true ) ).DataTable().columns.adjust().draw();
        } ); 
    });
    

    It works for me, with "autoWidth": false,

提交回复
热议问题