I am in need of a simple layout that spans 100% width of the browser window and includes a sidebar (<aside>
) and main content (<main>
) using flexbox. The sidebar has a constant width, while the main content should adjust to fill the remaining space.
Within the main content section, I have a large table that requires the use of Responsive tables in order to achieve horizontal scrolling within the table container only. However, encountering an issue where the horizontal scroll applies to the entire window instead.
<div class="d-flex w-100">
<aside>some sidebar content</aside>
<main class="flex-grow-1">
<div class="table-responsive"> <!-- problem is here! -->
<table class="table">
<tr>
<td>1.Test</td>
<td>2.Test</td>
<td>3.Test</td>
<!-- ... -->
<td>21.Test</td>
</tr>
</table>
</div>
</main>
</div>
Here is an example link: https://jsfiddle.net/cichy380/q34p5j1u/