I am working on an app that utilizes a grid with rows and columns. One of the features allows me to dynamically remove rows, causing the remaining items to evenly distribute themselves across the width of the grid.
However, I now require a layout similar to flex but using grid instead. Specifically, I need each grid item to have a margin next to the adjacent item, as shown in this example, without distributing themselves across the entire width.
CSS
.column {
padding: 10px;
margin: 10px 0;
display: grid;
grid-auto-flow: column;
.row-item {
text-align: center;
display: grid;
grid-auto-rows: 25px;
grid-row-gap: 10px;
width: 9vw;
}
}
HTML
<div class="column">
<ng-container *ngFor="let jS of journeyStepDisplay">
<div *ngIf="jS.display" class="row-item">
<div class="column-item header">
<p>{{ jS.name }}</p>
</div>
</div>
</ng-container>
</div>