Click here to get back home

how to properly hide/show table cells?

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
how to properly hide/show table cells? soni2926 01-31-2008
Get Chitika Premium
Posted by soni2926 on January 31, 2008, 5:38 pm
Please log in for more thread options
hi,
i have a table with rows, 2 columsn in a row. I need to hide and show
certain cells at a time, i'm able to do this via javascript, setting
each cell i want hidden with:
TableCellArray[i].style.display = "none";

where TableCellArray is the array of cells i have in my table. All
that works fine, but I keep getting spacing issues, it looksl like the
cell after it's set to none still occupies space, anyway to get rid of
that extra space? Each cell contains a div, i've also set that div to
style.display = "none"; but still no good. any ideas?

Thanks.

Posted by Ben C on January 31, 2008, 5:48 pm
Please log in for more thread options
> hi,
> i have a table with rows, 2 columsn in a row. I need to hide and show
> certain cells at a time, i'm able to do this via javascript, setting
> each cell i want hidden with:
> TableCellArray[i].style.display = "none";
>
> where TableCellArray is the array of cells i have in my table. All
> that works fine, but I keep getting spacing issues, it looksl like the
> cell after it's set to none still occupies space, anyway to get rid of
> that extra space?

It shouldn't do. Making the cell display: none should have just the same
effect as deleting the <td> from the document.

But tables are still square, so if you have two cells in a column and
you delete one you will see a gap.

> Each cell contains a div, i've also set that div to
> style.display = "none";

Not necessary. Display: none already causes the descendents not to be
displayed either.

> but still no good. any ideas?

You need to post a URL because it is a bit difficult to know exactly
what you're talking about or what effect you want. You also need to
explain whether you only get this problem in IE.

Posted by Jukka K. Korpela on February 1, 2008, 5:19 am
Please log in for more thread options
Scripsit Ben C:

> You need to post a URL

And to choose the right group. This group is about HTML, not styles or
scripting.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/


Similar ThreadsPosted
img table cells next to each other without a gap possible? May 26, 2006, 10:27 pm
fixed table cells January 23, 2007, 11:40 pm
Table cells change size March 1, 2005, 9:02 pm
Table with 100% width but relative cells? June 1, 2005, 11:08 am
DIVs inside table cells? April 13, 2008, 9:46 am
Freezing the width of TABLE cells June 20, 2008, 1:12 pm
Newbie: Problems with table cells & colspan August 9, 2004, 7:11 pm
There is no gap between cells in html table with CELLSPACING greater than zero August 25, 2004, 11:38 am
Optimized table with fixed size cells? February 4, 2007, 5:17 pm
HT make table data cells equal in width? May 9, 2007, 9:00 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap