For Bootstrap 3 and above
For Bootstrap 4
Bootstrap 4 now uses flexbox by default, so you get access to its magical powers straight out of the box. Check out the a that dynamically adjust width depending on how many columns are nested.
Here's an example:
<div class="row">
<div class="col">
1 of 5
</div>
<div class="col">
2 of 5
</div>
<div class="col">
3 of 5
</div>
<div class="col">
4 of 5
</div>
<div class="col">
5 of 5
</div>
</div>