-
-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible solution for fluid layout issue #45
Conversation
If table wrapper doesn't have a fixed height (as in examples) but it uses absolute positioning to use as much space as allowed by surrounding elements current implementation didn't work because the div container $container = $container.wrap("<div style='position: relative; clear:both;'></div>").parent(); will have a computed height of zero, and so will happen with the table wraper put inside. Changing the container to use absolute positioning and setting top, bottom, right and left to zero (ie, use all available space) will solve the problem and allow us to use tables which height is not fixed. Anyway, I've set that configurable, behing default behaviour as it was.
Thanks for the pull request. Can you also provide a link to a jfiddle with example html that exhibits the problem that this pull request solves so that I can test / add it do the docs site before merging this in? |
Yes, I'll write the code as soon as possible. Maybe it could be solved with the existing options, who knows? On Tue, Feb 11, 2014 at 4:39 PM, Misha Koryak notifications@gh.neting.ccwrote:
Salú, tranquilidad y todo eso |
Maybe, or maybe we can auto detect that this is happening and not need an option. Id need to see it to wrap my head around it |
Hi, here you have a working example. http://jsfiddle.net/sharcashmo/4B8QM/ It uses floatThead patched so you can test what happens. The layout has floatThead works well as it is with the table at footer area; as it is However it doesn't work with the above table. You can play with #window If the new wraper is added around, with relative position, absolute The inner absolute positioned elements, however, take the closest parent Maybe there's a simpler solution, that worked for me. Regards, David (aka sharcashmo) On Tue, Feb 11, 2014 at 5:15 PM, Misha Koryak notifications@gh.neting.ccwrote:
Salú, tranquilidad y todo eso |
However, I think you're right. It could be autodetected. I think it will happen whenever the wraper element (the one use as Maybe it could be solved by checking how the wrapped element is positioned. On Wed, Feb 12, 2014 at 1:51 PM, David Lozano
Salú, tranquilidad y todo eso |
wow thanks for a detailed fiddle. Ill have to think about this and play with different possible solutions later today. Ideally id want to autodetect this, but only if the autodetection doesnt yield false positives on other layouts that we haven't considered. another idea i had was to add a class to the wrapper (ill probably do this either way) and let you css style it yourself to accommodate for this. I have to be careful not to solve every possible problem with the plugin and thus bloat its code and ease of use. That being said, ill have a hard look at this, and see if there is a solution that makes sense for everyone |
Hey, I am going to come back to this issue when I have time again, but for now you can use a new option added in 1.2.3 - .floatThead-wrapper {
position: absolute !important;
top: 0;
right: 0;
bottom: 0;
left: 0;
} Hopefully that workaround will work for you in the mean time. |
It is ok for me. Thanks! I'll try to think also in a solution that works transparently to the user.
|
I still can't get it to work. Here's my fiddle: http://jsfiddle.net/wr1dac7a/4/ |
@JanOonk here you go: |
If table wrapper doesn't have a fixed height (as in examples) but it uses absolute positioning to use as much space as allowed by surrounding elements current implementation didn't work because the div container
will have a computed height of zero, and so will happen with the table wraper put inside.
Changing the container to use absolute positioning and setting top, bottom, right and left to zero (ie, use all available space) will solve the problem and allow us to use tables which height is not fixed.
Anyway, I've set that configurable, behing default behaviour as it was.