SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: Freeze Panes in tables?
-
Feb 23, 2008, 00:13 #1
- Join Date
- Nov 2001
- Location
- Colorado
- Posts
- 2,085
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Freeze Panes in tables?
I'm trying to get freeze panes to work on a table; like Excel.
Here's what I got just using CSS (scroll down to see the horizontal scrollbar):
http://www.search-this.com/FreezePanes2.html
I'm now thinking it's not possible just using CSS, think we need some JS...
I'm only looking for the solution to work in Firefox.
Here is a solution that works in IE:
http://web.tampabay.rr.com/bmerkey/e...olumn-csv.html
any ideas?WordPress Plugins: Comment Info Tip
My Blogs: What a Savage | Search-This
Tools: Search Engine Decoder | PageRank Decoder
Podcast: Rand Fishkin | SitePoint Founders
-
Feb 23, 2008, 05:39 #2
- Join Date
- Jan 2003
- Location
- Hampshire UK
- Posts
- 40,556
- Mentioned
- 183 Post(s)
- Tagged
- 6 Thread(s)
Originally Posted by mark
Originally Posted by mark
Yes but that example is scripted using expressions which is a cheat. It's not a real css solution as it won't work with javascript disabled (and doesn't work in IE6 in standards mode either although I'm guessing it could be made to run).
You can do anything you like with expressions as its just a means of scripting via css.
-
Feb 23, 2008, 11:26 #3
- Join Date
- Sep 2005
- Location
- Tanzania
- Posts
- 4,662
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
I agree with Paul that expressions are a bad idea. They invalidate your CSS, are just javascript in a disgusting wrapper really, are refreshed whenever you do anything (like scroll, move mouse, etc.) and only work in one browser, so you might as well use proper javascript.
Some results in google
If it is the thead you are looking to fix, then you can give the tbody a size and overflow:auto plus some padding on the right to make space for the scrollbar. If it's a column or some other row in the tbody that you want to fix then you require something a bit trickier.
Perhaps you could apply position:fixed to the row/column in question. It may well be that when this happens the cells stay where they are, then you actually won't require javascript at all. Otherwise, you would need to find out their scrollTop values and then apply position:fixed using those. You will then also need to give the table or tbody some margin to make up for the fixed cells being removed from the document flow.
-
Feb 23, 2008, 11:28 #4
- Join Date
- Nov 2004
- Location
- Nelson BC
- Posts
- 2,310
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I recall there being a big thread on how to freeze header rows/columns in tables but I can't get the sitepoint search working. Mike Foster wrote something that worked for one member, I think it was this:
http://cross-browser.com/x/lib/view....bleHeaderFixed
See if that does it for you.
Bookmarks