How to set column widths to a jQuery datatable?

后端 未结 7 945
庸人自扰
庸人自扰 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 02:54

    Try setting the width on the table itself:

    You'll have to adjust the 650 by a couple pixels to account for whatever padding, margins, and borders you have.

    You'll probably still have some issues though. I don't see enough horizontal space for all those columns without mangling the headers, reducing the font sizes, or some other bit of ugliness.

    提交回复
    热议问题