seventheyejosh Posted July 15, 2009 Share Posted July 15, 2009 Hello all! I have a simple js function that toggles a tr's style like so: <tr style="display:none;" id="tr1"> <td colspan="4"> my problem is that when i hit the js and toggle the display which does a document.getElementById('tr1').style.display='block'; it makes the inner td lose all of its colspan properties. basically if i take off the display:none, the whole page shows up fine. but if i leave it on and use the button to toggle the display, the whole page borks, because the colspan is lost. is there a way to fix this? Thanks Quote Link to comment Share on other sites More sharing options...
rhodesa Posted July 15, 2009 Share Posted July 15, 2009 instead of block, use 'table-row': document.getElementById('tr1').style.display='table-row'; if you didn't have the style on to start, you could do: document.getElementById('tr1').style.display='none'; document.getElementById('tr1').style.display=''; setting it to empty will restore it to it's default...but you default it to none...so that won't work Quote Link to comment Share on other sites More sharing options...
seventheyejosh Posted July 15, 2009 Author Share Posted July 15, 2009 table row did the trick thank you good sir. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.