Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] hiding single td cells


  • From: sclay at ufl.edu (Steve Clay)
  • Subject: [Javascript] hiding single td cells
  • Date: Tue Apr 25 08:34:56 2006

Tuesday, April 25, 2006, 8:54:20 AM, Michael Borchers wrote:
>> Where are you testing? Internet Explorer doesn't support display:
>> table-cell. You should toggle between "none" and "".

> and thanks to IE :(

IE not supporting table display properties does cause this particular
problem, but resetting style properties to an empty string is a good
general method of allowing element style properties to return to their
value defined in the CSS.

For example, a generic "toggle" script should toggle display between "none"
and "" (instead of "block") because you can then safely restore inline
elements, table cells, table rows, etc.

One thing to look out for is that Safari may require you to reset each
property of a shorthand property. If you set el.style.background = 'red',
to restore the background completely you need:

with (el.style) {
    background = backgroundColor = backgroundImage = backgroundRepeat =
    backgroundAttachment = backgroundPosition = '';
}

Another reason why classNames are the way to go if you can.

Steve
-- 
http://mrclay.org/