I am attempting to ensure that the width of the label column in a horizontal form is consistent across all rows of the form based on the size of the largest label. Please refer to the following image for clarification:
All label columns within the form should automatically adjust to the red line.
Below is the code I am using to create the form in the screenshot:
<form>
<div class="form-group form-row">
<div class="col-6 row">
<label for="1" class="col-auto col-form-label">Label 1:</label>
<div class="col">
<input type="text" class="form-control" placeholder="">
</div>
</div>
<div class="col-6 row">
<label for="2" class="col-auto col-form-label">Label 2:</label>
<div class="col">
<input type="text" class="form-control" placeholder="">
</div>
</div>
</div>
<div class="form-group form-row">
<div class="col-6 row">
<label for="1" class="col-auto col-form-label">Label 1 row 2:</label>
<div class="col">
<input type="text" class="form-control" placeholder="">
</div>
</div>
<div class="col-6 row">
<label for="2" class="col-auto col-form-label">Label 2 much longer on row 2:</label>
<div class="col">
<input type="text" class="form-control" placeholder="">
</div>
</div>
</div>
<div class="form-group form-row">
<div class="col-6 row">
<label for="1" class="col-auto col-form-label">Label 1 is even longer on row 3:</label>
<div class="col">
<input type="text" class="form-control" placeholder="">
</div>
</div>
<div class="col-6 row">
<label for="2" class="col-auto col-form-label">2:</label>
<div class="col">
<input type="text" class="form-control" placeholder="">
</div>
</div>
</div>
</form>
Is it possible to achieve this using Bootstrap 4 or other CSS? I am using it in an Angular app, so any help would be appreciated.