I'm currently developing a details page that is pulling information from a database. This details page has the potential to display related data from two other tables, each of which could have zero or multiple records to show.
The layout I am using (utilizing Bootstrap) is as follows:
<div class="scrolling">
<h2>First Group of Records</h2>
<ul class="list-group">
<li class="list-group-item">
Details of related record
</li>
...
</ul>
</div>
<div class="scrolling">
<h2>Second Group of Records</h2>
<ul class="list-group">
<li class="list-group-item">
Details of related record
</li>
...
</ul>
</div>
The CSS style for the scrolling
class is:
.scrolling {
height: 30%;
overflow-y: scroll
}
This setup is functional and provides me with most of what I need, but I would like the scrolling divs
to contract if the extra space is unnecessary. Is there a way to achieve this using existing Bootstrap functionalities or additional CSS?