Published: Mar 14 2007 / 18:26
Can't this be done by simply putting the table in a fixed-size div and adding the CSS "overflow: scroll;" property?
the table head and foot would not stay in place that way. this appears to only scroll the tbody part.
One tiny little thing though. He put the tfoot after the tbody instead of before.
Hmm, right, didn't think about that.
Still, if I *really* needed scrollable tables with headers, I think I'd just place headers, than a div which contains the table and use CSS.
I mean, seriously, how long is that code? Not to diss the author or anything - it's amazing what he managed! - but that isn't worth it IMHO :)
It makes me wonder, however, whether we don't need a more high-level "toolkit" for the web.
So I can go all "Table names = new Table(); names.setScrollable(Table.BODY);" or something like that.
I really think we should rework how the web's GUI design works. Separation of content & lay-out is great, but this is still way to basic. We need more advanced features too. Some complain that Java Swing is too low-level, but compared to the Web, it's incredibly high-level.
Maybe my Java-ish solution isn't the way to go, though (actually, it most probably isn't, seeing as how I'm totally inexperienced). Maybe "all" we need is a more feature-complete CSS. I'm wondering what the CSS syntax would be for only making the table's items scrollable, but I just can't think of anything clean that would fit into CSS's current syntax. Maybe CSS is just designed for more simple things, and CSS needs to be replaced.
Or maybe we could have multiple frameworks, and we'd just import the ones we want. Can you notice I've been learning Java these days? :-)
Okay, enough philosophical ramblings for today :-) Just thought I'd share some thoughts I've been having for a couple of days now.
I'm a completely novice programmer, so any thoughs / insights about my comment would be really appreciated - I'm curious to hear if I'm totally overseeing something.
Much more coding involved, but more useful is the Rico LiveGrid library that pulls data from the server as the user scrolls the table (an alternative to the traditional paging model)
Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.