tags:

views:

39

answers:

2

Hi,

I have a html table that I have setup in a 3 rows by 2 column formation. So basically have 6 cells that are currently being displayed to the suer.

My question is an unsure how to do, is that I only want to use 5 cells only visible to the user so would like to somehow remove cell position (3,2), so that it doesn't show any borders at all for that cell alone - can this be done, if so, how?

Thanks.

+1  A: 

look up the css properties border-collapse and empty-cells

Ref: http://www.quirksmode.org/css/tables.html

Scroll down the page and look at the examples of empty-cells:hide also check the browser compatibility chart at the top of the page.

Moin Zaman
Thanks @Moin. FYI, I have added empty-cells:hide into my style sheet and all seems to work fine but it leaves a grey color in place. Am I able to control this color as my site is on a white background?
tonsils
All good Moin - just added background-color to table style.
tonsils
A: 

Let's assume you have cell at 3,2 as cell data

When you want to hide it, execute cell32 = document.getElementById("cell32"); cell32.style.display = "none";

However if you hide a middle cell, your other cells will shift left. To preserve table structure, you need to replace hidden cell with a special cell having empty ( ) content and no borders as you want.

Mike