simpli Posted April 5, 2009 Share Posted April 5, 2009 Hi, I have a table where I load several tbodys (one for each user in my database). On click on the first row of the table, the below tbody collapses. That works fine. Currently, when the page loads however the whole detail is shown for everyone. I would like my table to show in the collapse state when the users come in and then they can choose which section they want to expand. I built a javascript that hides each tbody. I tried calling it plain from my php: HideTable("tb_" . $currentparticipant); It of course didn't work as it said that the function is not defined (normal I am calling a js function from phscript). My question is: Which event handler could I hook into to hide each tbody of the table when I'm done loading my dynamic data into it? Do you have any suggestions? Thanks, J-R Link to comment https://forums.phpfreaks.com/topic/152649-collapse-all-table-upon-load/ Share on other sites More sharing options...
Floydian Posted April 6, 2009 Share Posted April 6, 2009 typically, I'd attached a class to the tbodies that hides them so, the class is already on the tbodies and they are already hidden. no js required for that then when you go to expand, just remove the css class Link to comment https://forums.phpfreaks.com/topic/152649-collapse-all-table-upon-load/#findComment-802174 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.