I have a form with the following 2-column layout. It displays well on a desktop browser. For this example, each letter/number combo is an input field:
col-md-6 col-md-6
A1 | B1
A2 | B2
A3 | B3
A4 | B4
A5 |
A6 | B6
I separated the input fields by rows. For example, input fields A1 and B1 are both in one row. A3, B3, A4, B4, and A5 are also in one row. I did this so that I wouldn't have to measure and impose a height on B3 and B4 to keep the spacing aligned between columns.
However, when I resize to a mobile browser, I want all the B values to fall under the A values like so:
col-xs-12
A1
A2
A3
A4
A5
A6
B1
B2
B3
B4
B6
I've looked at several different methods involving push and pull, but I can't seem to find a CSS-only solution. There are about 80 input fields on the page. I also tried to measure heights but this is proving to be a clunky way to do it since the fields change frequently and I need to re-test the display on numerous browsers.
Any clever solutions?
UPDATE:
Here's a working example of two rows for brevity, as requested in the comments:
<div class="row">
<div class="col-md-6 form-group-primary">
<form:input path="firstName" type="text" class="form-control"/>
</div>
<div class="col-md-6 form-group-container-co">
<form:input path="coFirstName" type="text" class="form-control"/>
</div>
</div>
<div class="row">
<div class="col-md-6 form-group-primary">
<form:input path="lastName" type="text" class="form-control"/>
</div>
<div class="col-md-6 form-group-container-co">
<form:input path="coLastName" type="text" class="form-control"/>
</div>
</div>