table header width not aligned with body width
table header width not aligned with body width

I am using datatables jquery, When running the application, the header width is not aligned with the body width.But when I click on the header, it is getting aligned with the body width but even then there is some light misalignment.
This discussion has been closed.
Replies
Try adding
width="100%"
to your table in HTML. If the table is hidden you may need to usecolumns.adjust()
to recalc the column width after the table becomes visible.If these don't help please provide info about your environment and Datatables config.
Kevin
Thanks Kevin, columns.adjust() makes the job
Hi
I have the same problem (header text is not align with table body) but the columns.adjust does not help
And the table is setup by
Please help. Thank you
@tnthieu the problem is specific to your environment and config. In order to help we will need to see a link to your page or a test case replicating the issue. You code snippet above doesn't not have enough information to help.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
hi @kthonrngren,
sorry I cannot duplicate all the datatable. But I tried to put most of all the configuration
http://live.datatables.net/vazugavu/1/edit
Please have a look
Thank you
You are getting syntax errors which causes the Datatable to not load. We actually need to see the problem in order to help. Likely the problem is a CSS issue.
Its not expected to duplicate all the Datatable. What we want is to have enough of the environment duplicated so we can see the problem. Since you are using Ajax data you can take a sample of the data, place it into a Javascript variable then use
data
to provide the data to Datatables. You can remove the Ajax option. See this example:https://datatables.net/examples/data_sources/js_array.html
Kevin