I have a layout with main content in the middle and an action/info stuff on the right sidebar. (the left sidebar is hidden on mobile). I am hoping to combine these bootstrap columns. I want the first row of the right sidebar column to be between the two rows of the middle/main column when viewing on mobile. And the second row of the right sidebar column to come after all rows of the middle/main column when viewing on mobile. Here's what it looks like on large:
|------| |----|
| c1r1 | |c2r1|
| | |----|
|------| |c2r2|
| c2r2 | | |
| | |----|
| |
| |
|------|
And here's what I need it to look like on small (I started coding for mobile first, but it's easiest to show from large to small):
|------|
| c1r1 |
| |
|------|
| c2r1 |
|------|
| c1r2 |
| |
| |
|------|
| c2r2 |
|------|
Is there a way to achieve this organically using bootstrap or other css? If I use just one column for both, then the height of each row will be the same and/or not line up correctly with the elements above/below.
Here's basically my code:
<div class="container-fluid">
<div class="row">
<div class="col-md-3 d-none d-md-block">
<div class="row">Some stuff in the first col that doesn't show on small</div>
</div>
<div class="col-12 col-md-6">
<div class="row">The main column first row</div>
<div class="row">The main column second row</div>
</div>
<div class="col-md-3 col-sm">
<div class="row">Sidebar action item stuff that should go below the main column first row</div>
<div class="row">Sidebar info that should go below the main column second row</div>
</div>
</div>
</div>