The Table header does not align with data column
The Table header does not align with data column
nightsky_ting
Posts: 17Questions: 4Answers: 0
Hi,
May I know how to allow the header to align with data column. When I run the web application, the header does not align with the column until I click on the header then it will be align.
$('#tableLang').DataTable({
scrollY: "150px",
autoWidth: true,
responsive: true,
scroller: true,
paging: false
});
How to solve this problem?
Thanks
This discussion has been closed.
Answers
My guess is that you are initialising the table while it is hidden, perhaps in a tab? You need to call
columns.adjust()
when it is made visible.Allan
Hi,
I tried. It still cant work.
I initialized it when the document is ready()
$(document).ready(
and
I tried table.columns.adjust().draw() in the tab which is partial view is not working too.
How to solve this problem?
Thanks
Happy to take a look at a test case showing the issue.
Allan
Sorry, May I know how to show you?
paste all the code here?
https://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read#latest
Information on providing a test case is available here.
Allan