Using Bootstrap 4 to display a series of images using row and col classes
<div class="container-fluid">
<div class="row">
<div class="col">
<figure class="figure">
<a href="FixSongsReport00211_changesVarious Artists_Sounds of the Sixties 1960 Still Swinging.html">
<img src="../style/images/folder.jpg" class="figure-img" width="200" height="200">
</a>
<figcaption class="figure-caption">
Sounds of the Sixties 1960 Still Swinging
</figcaption>
</figure>
</div>
<div class="col">
<figure class="figure">
<a href="FixSongsReport00211_changesVarious Artists_Stage + Screen.html">
<img src="../style/images/folder.jpg" class="figure-img" width="200" height="200">
</a>
<figcaption class="figure-caption">
Stage + Screen
</figcaption>
</figure>
</div>
</div>
</div>
My problem is that when we get to end of list so we have less images then could be fitted into last row they are spaced out to use the available space. If you see the screenshot I want the last two images to take the left hand of the screen rather than being spaced out.
How do I achieve that ?
Looks particulary bad when only have a couple of items
i.e
The answers suggesting grid worked for last line, but only if have multiple lines. I modifield the outer div to use grid by remving class and adding style style="display:grid;grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));grid-gap: 5px;".
This fixes the issue with the last row (1st image), however it has no effect when only has one row (2nd image), any ideas ?
The flexbox solutions seem to involve hardcoding various things, dont seem that they would work in the general case.