How do I prevent the content of a long table or list from displaying over my footer if it takes up more than 100% of the height of the screen? I'd like the table to be responsive and take up the entire div. I've tried this answer but manually setting the bottom-margin did not help. My current ad-hoc solution is to manually limit the table height to prevent if from spilling over the footer. Below is the index.html that extends from base.html
/* style.css */
html {
font-family: Arial, Helvetica, sans-serif;
}
header {
padding-bottom: 16px;
}
body {
padding-bottom: 120px;
}
div#sp500Table.table-responsive {
overflow-y: scroll;
height: 500px;
}
<!-- Bootstrap 4 -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<!--base.html -->
<body class="bg-dark text-white container-fluid">
<header class="navbar navbar-expand-sm navbar-dark sticky-top bg-dark">
...
</header>
<main role="main">
<div class="container-fluid d-flex">
{% block body %} {% endblock %}
</div>
</main>
<footer class="page-footer font-small fixed-bottom">
<div class="container">
...
</div>
</footer>
</body>
<!-- index.html -->
{% extends 'base.html' %} {% block body %}
<div class="table-responsive" id="sp500Table">
<table class="table table-light table-striped table-sm" id="sp500Table">
<thead class="thead-light">
<tr> {% for col in table_header %}
<th>{{ col }}</th>
{% endfor %}
</tr>
</thead>
<tbody> {% for num, r in enumerate(payload) %}
<tr>
<td>{{ num+1 }}</td>
<td>{{ r.get('symbol') }}</td>
<td>{{ r.get('security') }}</td>
<td><a href="{{ r.get('sec_filings') }}" target="_blank">link</a></td>
<td>{{ r.get('sector') }}</td>
<td>{{ r.get('sub_sector') }}</td>
<td>{{ r.get('headquarters') }}</td>
<td>{{ r.get('date_first_added') }}</td>
</tr> {% endfor %}
</tbody>
</table>
</div>
{% endblock %}