I'm trying to set an auto-height to a parent div that has an absolute inner-most child. Let's say I have 3 elements. One parent div, a table, and an inner-div (which has the absolute position) inside the table. By default, all of the inner-most divs are hidden. But then after click a a certain event that makes this inner-most divs appear, the parent div have to accommodate these by setting up an auto-height. But the problem with absolute elements, their dimensions cannot affect the dimensions of the parents. Can you tell me how to achieve this using JavaScript? Thank you.
<div class="parent">
<table>
<thead>
<tr>
<th>col1</th>
<th>col2</th>
</tr>
</thead>
<tbody>
<tr>
<td>row1<td>
<td>row1<td>
</tr>
<tr>
<td>row2<td>
<td>row2<td>
</tr>
<tr>
<td class="inner-div">
row3
<div class="inner-child">
<table>
<thead>
<tr>
<th>col1</th>
<th>col2</th>
</tr>
</thead>
<tbody>
<tr>
<td>row1<td>
<td>row1<td>
</tr>
<tr>
<td>row2<td>
<td>row2<td>
</tr>
</tbody>
</table>
</div>
<td>
<td>row3<td>
</tr>
</tbody>
</table>
</div>