If we take a look at this minimalistic below example where I layout two columns with class col-auto. I.e.: take the space you need.
.row {
background: #f8f9fa;
margin-top: 20px;
}
.col {
border: solid 1px #6c757d;
padding: 10px;
overflow: auto;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.css">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.js"></script>
<script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.js"></script>
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.css">
<div class="container-fluid w-100">
<div class="row flex-nowrap">
<div class="col-auto">
"Loremipsumdolorsitamet,consecteturadipiscingelit,seddoeiusmodtemporincididuntutlaboreetdoloremagnaaliqua.Utenimadminimveniam,quisnostrudexercitationullamcolaborisnisiutaliquipexeacommodoconsequat.Duisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeufugiatnullapariatur.Excepteursintoccaecatcupidatatnonproident,suntinculpaquiofficiadeseruntmollitanimidestlaborum."
</div>
<div class="col-auto">
2 of 2
</div>
</div>
</div>
The problem now is that the first column takes so much space that it overrides the second column and even the viewport. Is there a neat way to ensure that each column, although able to take available space, not to be too greedy and still leave space for the other columns? It should then simply display a scrollbar for its own content and the second column should simply be a very small column for the text '2 of 2'.
Note that I deliberately want them to be next each other and not wrapped to the next line.
In your first column:
text-break
col-auto
by acol
Bootstrap text-break Doc
Difference between bootstrap
col
andcol-auto
:DEMO: