i have a jsp page where iam fetching data from DB. i want to display this data as accordion in table row. but the accordion is displaying outside the table, inside table only values are displaying. i want accordion as table row when i click on this table row it should expand.
<table class="content-table">
<thead>
<tr>
<th>h1</th>
<th>h2</th>
<th>h3</th>
</tr>
</thead>
<tbody>
<%
String strQuery = "select * from mytable;
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs = null;
try {
conn = precert.Databasebean.getConnectionS();
ps = conn.prepareStatement(strQuery);
rs = ps.executeQuery();
while(rs.next()){
%>
<tr>
<div class="accordion">
<button type="button" class="accordion__button">button
<td> d1 </td>
<td> d2 </td>
<td> d3 </td>
</button>
<div class="accordion__content">
<p>
lorem lorem lorem
lorem lorem lorem
</p>
</div>
</div>
</tr>
<%
}
}catch(Exception ex)
{
ex.printStackTrace();
}
finally {
Databasebean.closeAll(conn3, rs3, ps3, null);
}
%>
</tbody>
</table>
Thanks