Bad header alignment when ScrollY is Activated
Bad header alignment when ScrollY is Activated
prox108
Posts: 27Questions: 12Answers: 0
Hi Guys, I have a problem using the ScrollY propiety:
When resize the window the header doesn't adjust with the table.
I share with you a link to show you an example:
https://live.datatables.net/kucuribu/1/edit
I use Datable 1.11.5 and Bootstrap 3.3.6.
I really think is some class from Bootstrap because when I change the clases that livedatable has as default on its tamplete, and only then, the problem appears.
Answers
Add
style="width:100%"
to thetable
tag as shown in this example. Updated test case:https://live.datatables.net/kucuribu/2/edit
Kevin
For info DataTables 2.1 is going to add that style if there is no explicit
width
orstyle="width:..."
attributes on the -tag table`. This footgun turns up a lot.Allan
Very nice! Will be helpful and hopefully less forum questions.
Kevin
It didn't work, I found out something rare and maybe the cause of the problem.
Behind I think Bootstrap change some structure (creating new tags) and only worked when I also changed this to width:100%:
Now I only need to find out how to change that after is created.