[thelist] dynamically hiding table rows?

Brian Cummiskey brian at hondaswap.com
Fri Jun 1 08:19:07 CDT 2007


Jay Blanchard wrote:
> [snip]
> possibly this is a stupid question, nevertheless: In an application
> we're currently building, I'm about to try to dynamically hide table
> rows using JavaScript and switching "style.display" between "block" and
> "none". This works fine so far, except for one problem: As soon as I
> make a table row "disappear" setting display to "none", all of its
> content vanishes (good) but leaves a white empty space in my table
> where the disabled row used to be (bad). Not sure whether my approach
> is too naive to actually do that, but it doesn't seem all that bad. Can
> anyone point me where to peek to not just make the table row content
> disappear but also the "empty" space it leaves around, right now?
> [/snip]
>
> Having just tried this a couple of weeks ago I think I can help. I had
> to separate my table content into separate tables (I was hiding/showing
> several rows at a time) and the only effective way was to hide each
> table. Part of this is because a table is a block level element, a table
> row is not.
>   
using style and display options is not the "correct" way, which is why 
you're having issues.

You want to use the DOM.

see:  http://www.mredkj.com/tutorials/tabledeleterow.html



More information about the thelist mailing list