How to dynamically change jQuery Datatables height

前端 未结 8 1910
情话喂你
情话喂你 2021-01-31 05:25

I\'m using jQuery Datatables. I want to change the height of the table whenever a user resizes the window. I\'m able to catch the window resize event which allows me to calculat

8条回答
  •  旧时难觅i
    2021-01-31 05:52

    This is work for me

    $(document).ready(function () {
                $('#dataTable1').dataTable({
                    "scrollY": 150,
                    "scrollX": 150
                });
                $('.dataTables_scrollBody').height('650px');
            });
    

提交回复
热议问题