Current time: 04-23-2014, 12:34 PM Hello There, Guest! (LoginRegister)

Post Reply 
Freeze panes at top of table like Excel
04-02-2008, 12:03 PM
Post: #31
Freeze panes at top of table like Excel
Well, let's see here...

Quote:The "customer" now asks if I can make the table smaller, like 680px, so it will fit within his frames. I tried some simple things, but the header columns got out of line with the body columns.
The reason that things are getting out of line is because the text you have in these boxes is too wide. The way browsers implement tables is that they'll generally obey your width settings as much as possible, but they're more interested in getting the table displayed correctly than they are in strictly following your width settings. If text forces the browser to make some columns wider (and later columns narrower) than you've specified, then that's what the browser is going to do.

In your case, all of your text is crammed in there pretty hard. Your date column, in particular, is throwing off everything in the table body. The text in your table header doesn't leave a whole lot of flex room. Something definitely needs to give, which means either you need to reduce the font size until things fit, reduce the number of columns somehow, or you tell your customer that 680px isn't possible.

Quote:They even sent a screen shot: http://ykfp.org/images/shot.jpg
I have no idea what to make of this screenshot. Or, I should say, I have seen IE6 and IE7 do stuff like that before, and fixing it tends to be a very detail oriented compete and total pain. It's entirely possible that getting the width issues fixed will (either directly or incidentally) fix this problem, too.
Visit this user's website Find all posts by this user
Quote this message in a reply
04-02-2008, 12:54 PM
Post: #32
Freeze panes at top of table like Excel
Since this is a topic of discussion, could you folks check out this sample that I did a long time ago and let me know if any given browser has issues?

removethismungepleaseNebula-RnD.com/freeware/ScrollingTable.htm

The "generate new report" link isn't intended to work. This was intended to be a simple POC for people in my business community asking how to do the scrolling table thing.

Email to j2fp7im02 - at - sneakemail.com, or comment here.

I really hate spam, sorry for the munges.
Thanks!
Find all posts by this user
Quote this message in a reply
04-02-2008, 01:25 PM
Post: #33
Freeze panes at top of table like Excel
Quote:I've noticed that 1 or 2 pixel gap in IE as well. Is that something I did? Is there a fix?

I haven't even gotten around to looking at the code yet, but I'd guess you might need some conditional comments for IE.

Personally, I tend to stick with things that don't require too much compatibility-hacking, since it always gives me the bad feeling that a future version of one of the browsers will break it again.

If nothing else works out, and you absolutely have to use that, one solution would be to design it once for each browser so it's flawless... then just include the right one based on the user agent. If I did that, I'd just pick the top 2 or 3 browsers, then choose one as a default for the other oddballs, or just default to a regular table with repeating headers ever 10 lines or so.

Disadvantage: More work.
Advantage: When a browser breaks it, you only have to deal with that browser and not worry about whether or not your "fix" will break it in another browser.

I don't necessarily mean repeat the whole table with data each time, but just multiple formats. It could just be one function that draws up the the correct table for that browser & populates it with the same data either way.

Other than that...

Have you tried column widths in both fixed pixel widths and percentages? I'd guess percentages would break easier between the header & table columns not lining up because of the amount of text in a cell.

Another guess would be that images might force things into place. Maybe if the header cells were images, so the amount of text (or its size) couldn't break the row... then maybe a bottom row in the table with invisible 1px gifs set to the same width as each column?

I'm not sure if it would work or not, and it's something I wouldn't even bother doing since it would remind me too much of dealing with the older versions of Netscape.

I'd probably say this: If it's just for one client, do whatever makes it work and has the least chance of breaking. If it's something you want to start using for others and implement it in different types of sites, I'd probably put the work into making sure it works perfect in each of the main browsers, even if it's a LOT of extra work.

Kinda like how some people write nice scripts the degrade beautifully over a bunch of different technologies, rather than breaking over a single problem like cookies, Javascript, Ajax, etc...

Quote:Why can't MS follow standards?

Because then they wouldn't be MS. Wink

--------------------------------------------------------
Tongue Maximum savings promo code: MaxSavingsAtDH
Visit this user's website Find all posts by this user
Quote this message in a reply
04-02-2008, 02:12 PM
Post: #34
Freeze panes at top of table like Excel
It looks fine on FireFox 2.0.0.13 on Linux, that Vista thing, and on Windoze 98SE.

Also looks fine on epiphany 2.20.1 on linux

Internet Exploder 6.0.2800.110615 displays it "ok" on Win98SE, but adds spacing between the cells - not objectionable but different than the others.

Same as above re cell spacing issue on IE 7.0.6.6000.16609 with that vista thing (no SP1 installed yet - I afraid Wink )

--rlparker
Find all posts by this user
Quote this message in a reply
04-02-2008, 02:30 PM
Post: #35
Freeze panes at top of table like Excel
Quote:Win98SE
Srsly?

-- si-blog --
Max discount on any plan with promocode SCJESSEYTOTAL
Visit this user's website Find all posts by this user
Quote this message in a reply
04-02-2008, 03:17 PM
Post: #36
Freeze panes at top of table like Excel
Quote:Win98SE .... Srsly?
Smile Hey! He asked, so I tested with everything I had laying conveniently around ... Wink

... and I find *that* preferable to that vista thing in a lot of ways and for several reasons! Srsly! Wink

--rlparker
Find all posts by this user
Quote this message in a reply
04-02-2008, 03:18 PM
Post: #37
Freeze panes at top of table like Excel
Is the stuff in white supposed to move? If not, then there's a problem on Firefox 3.0b4 on Linux, because it scrolls right along with everything else. Beyond that, it looks ok.
Visit this user's website Find all posts by this user
Quote this message in a reply
04-03-2008, 08:37 AM
Post: #38
Freeze panes at top of table like Excel
Thanks to those who tested it - I really appreciate it.
The first column in white is only supposed to scroll vertically, but always remain visible even when horizontally scrolling.
The top row in white is only supposed to scroll horizontally, but always remain visible even when vertically scrolling.
I'd be very surprised if the top row or side column scroll but will take a look if they do. Then again, hey, it's only a demo.

RL - I believe the huge cell size was intentional just to give the table some width to demonstrate the scroll. If you do not see that then your browsers are doing you a "favor" and resizing cells despite the explicit code setting.

Regards to all.
Find all posts by this user
Quote this message in a reply
04-03-2008, 09:01 AM
Post: #39
Freeze panes at top of table like Excel
Quote:The first column in white is only supposed to scroll vertically, but always remain visible even when horizontally scrolling.
The top row in white is only supposed to scroll horizontally, but always remain visible even when vertically scrolling.
I'd be very surprised if the top row or side column scroll but will take a look if they do. Then again, hey, it's only a demo.
I would definitely take a look at the Firefox beta, in that case, because those white boxes are not doing what you just described (at least for me).
Visit this user's website Find all posts by this user
Quote this message in a reply
04-04-2008, 08:43 PM
Post: #40
Freeze panes at top of table like Excel
If a new Firefox beta is available which does not behave like prior releases and which is not compliant with other browsers (even IE works for this one) then I think someone is FLOSSLand has screwed up. I'll make some inquiries. Thanks.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: