In this simplistic example below, I have implemented two columns using the col-auto class, allowing each column to take up the necessary space.
.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">
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
</div>
<div class="col-auto">
2 of 2
</div>
</div>
</div>
OUTPUT: https://i.sstatic.net/UjfIz.png
The issue arises when the first column extends beyond the viewport and overlaps the second column. Is there an elegant solution to ensure each column can expand to fit available space without dominating the layout? Ideally, the solution should include a scrollbar for content overflow and maintain a small size for the second column displaying '2 of 2'.
Please note that I prefer the columns to be aligned next to each other rather than wrapping to the next line.