I am seeking your help in implementing a feature to expand and collapse multiple rows dynamically using JavaScript. These rows are generated based on query results, displaying folder names and their subfolders. Below is the code snippet for the table structure:
<table border="0" cellspacing="1" cellpadding="0" width="100%" height="106">
<%
int i=1;
int j=0
do
{
//Executing SQL Query
String sz_FolderName=res.getString(2);
String sz_NumberOfDocument=RS_NumberOfDocument.getString(1);
%>
<tr>
<td><%=i%></td>
<td>
<span style="text-decoration: none">
<%=sz_FolderName%><img id="image<%=i%>" src="../expand.gif"> <span></td>
<td>
<p align="center"><%=sz_NumberOfDocument%></td>
</tr>
<%
//Executing SQL Query
String Subsz_FolderNumber=Subres.getString(1);
String Subsz_FolderName=Subres.getString(2);
%>
<tr>
<td>
<p style="text-align: left"> </td>
<td>
<p style="text-align: left">
► <%=Subsz_FolderName%></td>
<td style="text-align: center;">
<%=sz_FolderName%></td>
</tr>
<%
}
j++;
i++;
}
%>