<div class="modal-body">
<div class="table-responsive">
<table id="table">
<thead>
<tr>
<th>...</th>
...
</tr>
<thead>
<tbody>
<tr>
<td>...</td>
...
</tr>
<thead>
</table>
</div>
</div>
I am looking for a way to dynamically adjust the height of my table based on the number of rows it contains. Specifically, I want to set a maximum height (N px), but if there are fewer rows needed to fill less than N px, I want the table's height to adjust accordingly. I attempted to use max-height property without success, as the container was then empty.
Here is the code snippet I tried: JSFiddle Link