Sorry Sage, it did not work.
Main Topics
Browse All TopicsI need to create expand/collapse feature in ASP. Toggle works fine. I have put the content to be shown/hidden inside div tag. The div tag is shown/hidden using javascript method.
When the div is hidden, I am getting extra row. I noticed that div is inside <TR>. I am hiding/showing div but not doing anything about <TR>. That means the extra row is created by <TR>. If I put <TR> inside div toggle functionality does not work.
Please help how to fix this
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I still have the same problem.
In my code snippet
line#2 <TR> is always visible. It has the toggle link/button. By clicking on it, user should be able to see TR in line3.
I tried removing <tr> in line 3 before <div>. Then toggle code does not work. Seems to me that <div> should be in a <TR> if it is embedded inside <table>
Before expand/collapse code this is how my code is:
<TABLE>
<TR><td>test1</td><td>test
<tr><td>test3</td><td>test
<tr><td>test5</td><td>test
</TABLE>
The requirement is: When user toggles on row1 then only I need to show last two rows.
Then I started using div tag concept. Is there any other solution to achieve this
like this:
<TABLE border="1">
<tr onClick="toggleDisplay('te
hide TR</td></tr>
<tr ID="test"><td colspan=2>
<div>
<table>
<tr><td>test1</td><td>test
</table>
</div>
</td></tr>
<tr ID="test2"><td colspan=2>
<div>
<table>
<tr><td>test1</td><td>test
</table>
</div>
</td></tr>
</TABLE>
Right now I am using the idea of hiding/showing TR instead of div.
In your code snippet at line2
<tr onClick="toggleDisplay('te
At this stage I do not know how many rows I have later. So I do not know about 'test' and 'test2' names
I have written javascript method. I have 2721 TR rows in one sample. Since I am using for loop , upon each toggle click it is taking a minute to process. Is there an easier way to fix this.
That's a lot of rows. Do you have to have your toggle control in one of the rows? Alternatives would include:
1. placing the toggle control outside the table that has all those rows, then hiding the table rather than individual rows.
2. keeping all rows that are to be hidden in their own table, then hiding that.
3. if your toggle must appear in a row, consider having two or more tables - one table for the toggle control row and other rows that are not to be hidden, and one table for only those rows to be hidden.
looping through a large number of anything and then taking some sort of action, can have a negative affect on performance, while acting on one single object, like a table with a bunch of rows, should be much faster.
Not sure if that's valid html, having the tbody tag in that position... You can check by running it through the markup validator at w3.org:
http://www.w3.org/QA/Tools
Business Accounts
Answer for Membership
by: SquareHeadPosted on 2008-01-10 at 12:06:14ID: 20630581
You try this instead:
style.visi bility=="h idden")? "":"hidden";
obj.style.visibility=(obj.