[Javascript] table collapse bug in IE6?

Paul Novitski paul at dandemutande.org
Fri Mar 26 14:05:10 CST 2004


I've run into a pesky problem with an application I'm writing that's 
dedicated to IE6:

I download a dataset to the browser as a table, then allow the user to 
select record subsets.  My Javascript record-selection function hides or 
unhides table rows; basically:

	if (bRowIsSelected)
	{
		oRow.style.visibility = "visible";
		oRow.style.position = "static";
	}else{
		oRow.style.visibility = "hidden";
		oRow.style.position = "absolute";
	}

I found that merely setting row visibility to hidden doesn't hide the rows 
-- they still take up space in my table, showing up as gray bands.  I have 
to set position to absolute to make them truly disappear so the table will 
collapse properly.  (Using visibility:collapse doesn't change this.)

However, doing so left fragmentary grey ghosts of cell borders on the 
screen when they disappeared.  I've hidden the cells within hidden rows as 
well, but I'm still getting some border ghosting.

Worse, when some rows are hidden and the table rearranges column widths 
naturally to accommodate the current content, fragments of borders are left 
scattered within the table area where the side borders of hidden cells once 
were.

I'm tired of hacking at this, and am resorting to removing, then completely 
rebuilding, my display table each time a record selection is made.  But the 
problem bugs me because collapsing tables would be such an elegant 
solution.  Has anyone encountered this problem and found a reliable 
solution or workaround?

Thanks,
Paul





More information about the Javascript mailing list