I am looking to create a 3X3 grid with 8 checkboxes, where the checkboxes are only visible under certain conditions and need to be dynamically filled into the grid. How can this be achieved using CSS and Bootstrap? The checkboxes should be organized from top to bottom and left to right within the grid, with no empty spaces if a checkbox is not visible.
Below is my code for a STATIC arrangement:
<div class="row row-checkbox">
<div class=" col-md-4">
<app-custom-checkbox formControlName="cb1" label="Checkbox1">
</app-custom-checkbox>
</div>
<div class=" col-md-4">
<app-custom-checkbox formControlName="cb2" label="Checkbox 2">
</app-custom-checkbox>
</div>
<div class="col-md-4">
<app-custom-checkbox formControlName="cb3" label="Checkbox 3">
</app-custom-checkbox>
</div>
</div>
<div class="row row-checkbox">
<div class="col-md-4">
<app-custom-checkbox formControlName="cb4" label="Checkbox 4">
</app-custom-checkbox>
</div>
<div class=" col-md-4">
<app-custom-checkbox formControlName="cb5" label="Checkbox 5">
</app-custom-checkbox>
</div>
<div class=" col-md-4">
<app-custom-checkbox formControlName="cb6" label="Checkbox 6">
</app-custom-checkbox>
</div>
</div>
<div class="row row-checkbox">
<div class=" col-md-4">
<app-custom-checkbox formControlName="cb7" label="Checkbox 7">
</app-custom-checkbox>
</div>
<div class=" col-md-4">
<app-custom-checkbox formControlName="cb8" label="Checkbox 8">
</app-custom-checkbox>
</div>
</div>