1. inline styles are less than ideal.
2. if an object is display: none; why bother setting its visibility?

how about this instead:
#mytable tbody {display: none;}
#mytable tbody.show {display: block;}

then in javascript:
mytbody.className = 'show' ;  /* show the tbody */
or
mytbody.className = '' ; /* remove the "show" class = return the default style 
= display: none; */

The idea is to keep the presentation details in CSS (preferrably in an easier-to-maintain external CSS file) and the behaviors for changing the presentation (via obj.className) isolated to the javascript.

Note: If you want to use multiple classes on the object, you will need to tweak the javascript - which is beyond the scope of this simple example and completely off-topic for css-d.

BTW, Are you doing anything to accommodate browsers with javascript unavailable?

On Fri, 17 Jun 2005 09:28:52 -0400
 Jason Kohls <[EMAIL PROTECTED]> wrote:
Hi all,

I'm having issues hiding and displaying table rows contained within a
tbody, specifically, Gecko-based browsers.

The initial state is to hide the rows. In order to do this in both IE
and FF, I used the following:

<thead>...
<tbody style="visibility:collapse; display:none;">
 <tr>...

Using javascript, I'm changing these styles to "visibility:visible"
and "display:block" in a function using an onclick event.

This works fine in IE; the rendering order is maintained and life is
wonderful.
In FF, however, the display: none is taking it out of the rendering
context (like it's supposed to) so when I change the
display/visibility attribute, the now visible tbody/tr's show up last
in the rendering order (below the tfoot even).

I've tried playing with positioning, etc.  is there:
a) a better way to do this?  If the initial state was to show the
rows, this works fine, but thats not what I need.
b) a way to force the rendering order using some CSS hack goodness? :)

Thanks in advance,
J
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


__________________________________________________________
This message was scanned by ATX
9:41:47 AM ET - 6/17/2005

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to