Columns don't fit to header - datatables with Scroller plugin

Columns don't fit to header - datatables with Scroller plugin

dacesiliandacesilian Posts: 3Questions: 0Answers: 0
edited December 2013 in Plug-ins
I'm using Datatables with Scroller plugin and server-side loading. When data are loaded, header columns are resized and often (not always) don't fit to inside columns.

Picture of a situation - http://i.stack.imgur.com/J3zMz.png .

Relevant datatables setting code:

[code]
"sScrollY" : window.innerHeight - 270,
"bServerSide" : true,
"sDom" : "frtiS",
"bProcessing" : true,
"bDeferRender" : true,
"bAutoWidth" : true,
"oScroller" : {
"rowHeight" : 33,
"autoHeight" : false,
"serverWait" : 100
},
[/code]

Is there any way how force header columns to always fit the content (and vice versa)?
Thanks.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Do you have border-collapse: collapse set? If so, that might be the problem. Beyond that, we'd need a link to the page to be able to discover why it is happening.

    Allan
  • dacesiliandacesilian Posts: 3Questions: 0Answers: 0
    Thank you, Allan!
    It was caused by this CSS padding:

    table.display thead th {
    padding: 3px 18px 3px 10px;

    When I remove this (horizontal) padding, columns are okay.
This discussion has been closed.