No data (dataTables_empty) colspan problem
No data (dataTables_empty) colspan problem
Hi,
When there is no records in the table, the dataTables_empty td is created with colspan="0".
I don't know why, but this only spans 1 column and the design breaks.
If i manually set it (with developer tools) to colspan="100%" it is ok.
How do i fix this permanently?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I only recently upgraded to a newest version of DT, and I did not have problems before that. It seems like TBODY>tr>td on empty table was introduced recently?
How can i remove that and go back to how it was?
I would like to have a centered text, not just inside first column.
OK so i tested it a bit more and this only happens when table is initialized.
If i have data in the table and do a simple search that will return no entries, everything is ok. Since i have a save state option enabled, when i reload a page and table is generated again (this time with saved state of search) and it return no records, the colspan on empty table is wrong (0).
This should be somehow properly calculated and return a correct number of columns for the colspan.
Is this normal?
Sounds like a bug caused by this commit.
Let me have a think about how to fix this and get back to you. Thanks for the heads up.
Allan
Great, thx Allan.
Fixed here. Thanks for letting me know about that issue.
The nightly is rebuilding at the moment with this fix. I expect DataTables 1.10.12 to drop in the next month or two depending on the fixes that are required - this one will bring that date closer since it is a visible issue.
Regards,
Allan
Will it be included in the next release? 1.10.11 does not seem to have this fix.
Yes it will be. The error was introduced in 1.10.11. It will be fixed in 1.10.12.
Allan
Thanks for the info, Allan!
Hey Allan, When is the 1.10.12 set to release?
Later this month. Probably the week after next.
Allan
Any news on 1.10.12?
Currently planning for this week :-). A few loose ends I need to wrap up first though.
Allan
Thank you Allan!
Just wanted to let everyone know that rather than waiting for the new version of DT, I just replaced the function _fnVisbleColumns for the new one in the commit referenced by allan and everything seems to be working just fine. Thanks a lot for all your help!
Or use the nightly version which contains the fix.
Allan
I find that this still happens if I have more than one DT on a page. The first displays but the 2nd and 3rd ones still display the message in one column.
If you could link to a page showing the issue that would be great.
Allan
Any updates about this? I am still facing this issue.
Per my last response in this thread, if you post a link to the page showing the issue we can look into the problem.
Allan