Column headers misaligned using sScrollX
Column headers misaligned using sScrollX
Setting the sScrollX options causes column headers to be misaligned until I click on one of the sort icons.
Widths on each td in dataTables_scrollHead are set to 0px until sort is clicked and then they are set to match the relevant body column width.
Digging into the functionality of the library but is there a way to invoke the functionality that sets the column header width to the width of the body columns without sorting the table?
Widths on each td in dataTables_scrollHead are set to 0px until sort is clicked and then they are set to match the relevant body column width.
Digging into the functionality of the library but is there a way to invoke the functionality that sets the column header width to the width of the body columns without sorting the table?
This discussion has been closed.
Replies
Allan
So I found a workaround which is to invoke fnDraw again after the page is rendered.
[code]
this.oTable = this.$el.find('#o-table').dataTable(this.dtOptions);
...
$('#modal').on('shown.bs.modal', function() {
if (this.oTable) this.oTable.fnDraw();
});
[/code]