Scrolling with dynamic columns

Scrolling with dynamic columns

foothfooth Posts: 4Questions: 0Answers: 0
edited May 2012 in General
I'm creating a table with dynamic columns using the method proposed by allan in this thread:

http://www.datatables.net/forums/discussion/152/dynamic-column-headers/p1

That works fine, but there are a lot of columns and the table gets really wide. The whole thing will display in the browser and one has to scroll the browser way over to the right to get to the page controls for instance.

I then saw that Datatables supports scrolling. I tried playing around with the scroll parameters but nothing seems to work. The closest I've gotten is by adding these:

"sScrollX": "100%",
"sScrollXInner": "110%",

I get a horizontal scroll bar, but the full table still displays (all the way over to the right) and the added scroll bar doesn't really do much. I've seen other people have problems with scrolling, but I haven't seen someone who was creating dynamic columns. I'm wondering if that might be the problem? Any suggestions?

-Jeff

Replies

  • foothfooth Posts: 4Questions: 0Answers: 0
    FYI, the issue I found was a result of wrapping the table in a "fieldset" tag. That seems to wreak havoc with the way the scrolling is doing things.
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Very odd - but interesting to know. I guess there must be something int he user agent default CSS for field set which results in the table not collapsing in size. I'll dig into that a bit more - thanks for the heads up.

    Allan
  • pnellesenpnellesen Posts: 1Questions: 0Answers: 0
    FYI, this only appears to happen in FireFox - wrapping the table in a fieldset in IE (7 and 8, at least) works fine.

    BTW - amazing plugin. Thanks for all the hard work :)
This discussion has been closed.