Expanding table help

S

Steve Pugh

Menolo said:
This works kind of ok in IE but does not restore correct in
Netscape/Firefox, please let me know how I can fix or is there a better way,
I would also like to incorporate a '+' and '-' image for expand and restore.
Thanks
http://www.kerryhotrod.com/test/expand.htm

Netscape and Firefox know that table rows are not display: block and
hence making them display: block will not restore their default
presentation.

Steve
 
M

Menolo

Thx for reply, that works and restores as I want in NN/Firefox now but will
not work in IE at all.
 
R

rf

Menolo said:
ok, please look and tell me where I am wrong.
http://www.kerryhotrod.com/test/table-row.htm

You have errors. Turn on error reporting in IE.

In any case we had almost exactly the same discussion a couple of months
ago.

IE does not understand table-row. If you specify this then it might barf.

Best is to swap between display="none" and display="". The latter is the
same as omitting the display: property. The browser will use whatever it
sees fit to use as the default.
 
M

mscir

rf said:
You have errors. Turn on error reporting in IE.

How about this, including these changes:

- use var x...
- use inline
- use href="#"


<script type="text/javascript">
function doTable(i){
if(!document.getElementById)return;
var d=document.getElementById(i);
var t=d.getElementsByTagName("TR");
for(var x=0;x<t.length;x++)
if(t[x].className=='expand')
t[x].style.display=(t[x].style.display=='none')?'inline':'none';
}
</script>
</head>
<body onLoad="doTable('table1'); return false;">

<a href="#" onclick="doTable('table1'); return
false;">Expand/contract</a></td>
 
R

rf

mscir said:
How about this, including these changes:

Why are you asking me? I'm not even vaguely interested in getting javascript
hiding stuff working.
t[x].style.display=(t[x].style.display=='none')?'inline':'none';

That is even more bizarre than the original problem.

Who knows *what* a browser would do with a <tr> with display: inline :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top