mynamesleo Posted November 22, 2006 Share Posted November 22, 2006 Hi, I am using the following JS function (found from google) to hide/show table rows[code]{ var tr = document.getElementById(id); if (tr==null) { return; } var bExpand = tr.style.display == ''; tr.style.display = (bExpand ? 'none' : '');}[/code]It works great, but is there a way to set the rows as hidden by default? as when the page is visited all rows are visible/open.Thanks Quote Link to comment Share on other sites More sharing options...
fenway Posted November 22, 2006 Share Posted November 22, 2006 Sure... add "style=display:hidden"... but that's dangerous for non-JS users. Quote Link to comment Share on other sites More sharing options...
mynamesleo Posted November 22, 2006 Author Share Posted November 22, 2006 Thanks for the reply, i am not sure where too add that though, this is the codeI tried add it in table row and data and css? is it for the js script? Quote Link to comment Share on other sites More sharing options...
fenway Posted November 22, 2006 Share Posted November 22, 2006 This would be on the TR tag itself. Quote Link to comment Share on other sites More sharing options...
mynamesleo Posted November 22, 2006 Author Share Posted November 22, 2006 Sorry but i'm still new to all this,<tr "style=display:hidden">That didn't work, is that what you meant? Quote Link to comment Share on other sites More sharing options...
mynamesleo Posted November 22, 2006 Author Share Posted November 22, 2006 Ah, style='display:none' works fine Quote Link to comment Share on other sites More sharing options...
fenway Posted November 24, 2006 Share Posted November 24, 2006 sorry, I meant "none"... i was thinking about visibility for some reason -- my bad. 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.