Absurd assignment of zero width to the table
Absurd assignment of zero width to the table
batch2k
Posts: 6Questions: 0Answers: 0
After some manipulations with dateTables plugin I got a very strange bug on my table -- it shrinks very much in width and the reason is that plugin assigns a "width: 0" property for the whole table and each heading column ().
Moreover, this bug appears only in one version of the page (english) and looks as usual (say, 'width: 904px') in other (russian) although they are built from single template.
I did not perform any modifications of the code or RSS; unfortunately, I can't give an example here because that page is 'hidden'.
What are the possible reasons for that? Maybe, I can have some racomendations on parts of the code where I can track this bug myself?
Moreover, this bug appears only in one version of the page (english) and looks as usual (say, 'width: 904px') in other (russian) although they are built from single template.
I did not perform any modifications of the code or RSS; unfortunately, I can't give an example here because that page is 'hidden'.
What are the possible reasons for that? Maybe, I can have some racomendations on parts of the code where I can track this bug myself?
This discussion has been closed.
Replies
If this will help, I can get rid of this parasitic effect by setting 'bAutoWidth' to false, and this will certainly help to locate the problem.
But anyway I'm interested in finding the bug.
This has been discussed a couple of times before:
http://datatables.net/forums/comments.php?DiscussionID=490
http://datatables.net/forums/comments.php?DiscussionID=491
Basically it's due to the fact that the web-browser has not yet calculated the width of the table, and therefore DataTables has no information for how to make it's calculations - so not too absurd :-)
You can set bAutoWidth to fast to get around this, or give the table an absolute width.
Regards,
Allan
It does seem like quite a good idea to put in a check to say if the calculated with is 0, then don't be "daft" and actually use it! It's possible to get unexpected effects such as the column widths jumping around a bit if this occurs - but it's probably better than what is there at the moment... I'll have a look at how suitable this will be and put it into the next release if it looks good.
Regards,
Allan