I'm creating a bootstrap responsive app to work on both desktop and mobile. I'm struggling to get one of my pages to display as-desired in both formats. I'd like it to look like the diagram below, but collapse to a single column with cells in the order of the numbers (1,2,3,4).
+------------+ +---------------+
| | | |
| | | |
| | | 2 |
| | | |
| 1 | | |
| | +---------------+
| | +---------------+
| | | |
+------------+ | 4 |
+------------+ | |
| | +---------------+
| 3 |
| |
+------------+
Right now, it looks like the diagram below:
+------------+ +---------------+
| | | |
| | | |
| | | 2 |
| | | |
| 1 | | |
| | +---------------+
| |
| |
+------------+
+------------+ +---------------+
| | | |
| 3 | | 4 |
| | | |
+------------+ +---------------+
which can be achieved using this code:
<div id="firstrow" class="row">
<div class="col-sm-8">
...
</div>
<div class="col-sm-4">
...
</div>
</div> <%# End firstrow %>
<div class="row">
<div class="col-sm-8">
...
</div>
<div class="col-sm-4">
...
</div>
</div> <%# End secondrow %>
I can get the desktop format right if I just use two columns, but then it would not collapse in the order I want (would be 1,3,2,4). I thought removing the "row" divs might help, but that appears to yield the exact same desktop format result.
Any thoughts on how this can be achieved, either using bootstrap (preferred) or custom CSS?
Cheers,
-Hamish