I would like to have a set of dynamic number of colums, with a fixed size margin, to be centered in my container. I am using bootstrap 4.0. I´ve googled for some time now, but can´t find the right solution.

Currently i have this markup:

<div class="container-fluid">
    <div class="row">
        <div class="col">1</div>
        <div class="col">2</div>
        <div class="col">3</div>
        <div class="col">4</div>
        <div class="col">5</div>

With five columns it results in this which is great: enter image description here

But with four columns it results in this: enter image description here

But this is what I would like to achieve: enter image description here

Any idea?

0 Answers