Initializing a table in a hidden div results in shrunken header widths
Initializing a table in a hidden div results in shrunken header widths
I have a table placed inside an div that is initially hidden. When a user submits a form to generate a report, the div appears and the header's widths are all 0px. I tried making the div appear by removing a class and altering the .css() in jquery. It seems that with the div hidden, anything initializing or adding rows to the table, the new rows/initializing takes on the div being 0px width 0px height.
My current workaround is, I initialize my table in my javascript, then do a $(table).hide() after. However, when I go and do a generate report and show the div, my "showing entries" at the bottom left overlaps my table, as if my table didn't push it down when rows were added.
Is this a bug?
EDIT - Just wanna add that if I have the div showing initially and I press the generate report button, the rows append and all elements get pushed down.
This question has an accepted answers - jump to answer
Answers
Can someone close this?
I'm presuming that you've resolved this now? You need to call
columns.adjust()
once the table has been made visible, as shown in this example.Allan
Yes, I asked this before but totally slipped my mind.