It seems you are making it very very difficult for yourself. Splitting data in 2 tables which in fact should be in one, not using a fixed width (px or %) for the table cel widths, mixing php, html, javascript/dom. I'm curious:
- why is it needed to use 2 tables? Why not start with one? Let the backend code spit out the minimal amount of html needed, so you have a nice seperation
- why no fixed width (px or %). Why not let the text flow down the cells. My example works perfectly.
- then if everything works nicely see if there's some possibility of using an unobtrusive js which can make the table th a fixed one. That way you start with clean code, clean seperation of php, html, css and js, and a semantic and accessible table
(not trying to be harsh here, only curious)
Two Tables
Moderator: General Moderators
If you check the example on http://www.quirksmode.org/js/fixedhead.html you can see what I am trying to achieve. I did say this was plan z so it is a bit messy. The problem is that the Fullname and Action columns could be any given widths so don’t really want it to look disproportioned. I may have to settle for fixed width but thought dynamic would be better and the way forward. The reason why I want two tables is so one can stay at the top fixed and the other in another div to scroll.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
What about creating your table, then creating one of those javascript based floating elements that stays in a fixed position on the screen? So when the user scrolls, the table header always appears to be floating at the top most part of the table. I'm just throwing out ideas to help you out, so if anything I say from this post on is crap, feel free to disregard it without hurting my feelings.
Just be gentle... I am a fragile man...
Just be gentle... I am a fragile man...
All input is welcome with open armsEverah wrote: I'm just throwing out ideas to help you out, so if anything I say from this post on is crap, feel free to disregard it without hurting my feelings.
Just be gentle... I am a fragile man...
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
I'm a Lotus Notes user at work (unfortunately - that is for a different discussion) so I am familiar with it, and your situation (I have gone through a few system disintegrations).
I am of the mind set that tabular data should be in tabular format, even with scrolling headers. So I would create my tabular display within a single table, and, if the data got too long, I would page it. That's just me, though. I'm a geek that way.
I am of the mind set that tabular data should be in tabular format, even with scrolling headers. So I would create my tabular display within a single table, and, if the data got too long, I would page it. That's just me, though. I'm a geek that way.