columns width 0% when initialize ,but become normal when zooming the page (Firefox)

columns width 0% when initialize ,but become normal when zooming the page (Firefox)

PallyPally Posts: 4Questions: 2Answers: 0
edited December 2017 in Free community support

Currently i'm using Datatables 1.10.6 (jquery.dataTables.js) , but because i need button extention , so i add Datatables 1.10.17(dataTables.js) too...

when i run it in chrome ,, the column width seems normal but,
The problem is when i run it in firefox the column header cells width default to 0% when loaded ..
https://drive.google.com/file/d/1FSs21oAL1eE40ZSXygV_kTh-tMXUd-rJ/view?usp=sharing

but when i zoom in / zoom out / inspect element the page, the column header width become normal in firefox.
https://drive.google.com/file/d/1fjyURO6ZkyUpC0flTCGNmGQrdRJ6FMUc/view?usp=sharing

Any idea? how to fix this issue?

var resultDataTable = $(tableId).DataTable({
"data" : data,
"columns" : jsonColumnData,
"columnDefs" : [ {
"targets" : invisibleColumn,
"visible" : false
},
{
"targets": lastIndex,
"data": null,
"defaultContent": s
},
{
"targets": accountingColumn,
"data": null,
"render": function ( data, type, row, meta ) {
return singleFormatNumber(data);
}
}
]
});

Answers

  • allanallan Posts: 63,461Questions: 1Answers: 10,466 Site admin

    My guess is that you are initialising the table while it is hidden. If that is the case then you need to call columns.adjust() when it is made visible.

    Allan

This discussion has been closed.