Hi I have a situation where I have a 'n' parent rows in a table and each parent has a 0 or more child rows. The number of columns is same in both parent and child. I need to collapse/expand (hide/unhide) the child rows when I click on the parent row.
For this I have a outer table where each row of the table contains either the parent data or a another table with a div that has all the child rows. I can expand/collapse with a js changing the style.
However the data in the child table does not line up with the data in the parent table. How do i fix the formatting or Do I build this dataset a different way.
Please help. Thanks
[ May 30, 2008: Message edited by: Pranav Sharma ]
UPDATE : Ok so I have been thinking about this, Im guessing the best way to align the data is to put all of them in 1 table and then hide the rows I want. If you think this is a better way, could you give me some direction for a generic hide/show method. I dont know how to keep track of the children for each parent.
TIA [ May 31, 2008: Message edited by: Pranav Sharma ]
posted 12 years ago
Ok, I think I got it, dont know if its the best way to do it so please let me know if there is a better way.
I read up on the table tag at w3.org, Im using the tbody tag to group the children rows and then hidiing/showing on the tbody id.
No. No. No. No. Changed my mind. Wanna come down. To see this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop