How to set column widths to a jQuery datatable?

后端 未结 7 959
庸人自扰
庸人自扰 2020-12-08 02:45

I have a jQuery datatable(outlined in red), but what happens is that the table jumps out of the width I have set for the div(which is 650 px).

Here is the screen shot

7条回答
  •  不知归路
    2020-12-08 03:14

    In java script calculate width using following code

    var scrollX = $(window).width()*58/100;
    var oTable = $('#reqAllRequestsTable').dataTable({
        "sScrollX": scrollX
        } );
    

提交回复
热议问题