[thelist] reading netscape table height?

jtocher jtocher at bellsouth.net
Wed Oct 2 23:43:07 CDT 2002

Hi all...

I'm designing a page whose content will be updated dynamically by
hiding/showing divs based on menu selection.

Because the content in the divs are different heights, I need to resize the
table row holding the divs.

The following script works fine on IE

function tbl_Height(ThisDiv) {
    if (document.layers){
        var height = document.layers['txt'+ ThisDiv].document.height + 50;
    else if (document.all){
       var height = document.all['txt'+ThisDiv].clientHeight + 50;
    var tbl = window.document.getElementById('tbl');
    tbl.style.height = height + 'px';

but, not on Netscape 6 or above - doesn't read the div height so the height
var not being set correctly. This script works fine to write an absolute
value to the height, but not reading height of the specified div.

Can anyone show me the error of my ways?

Thanks much!

More information about the thelist mailing list