I'm currently working on a website that utilizes the Bootstrap 4.5 framework. My goal is to create a table where the first column automatically adjusts its width based on its content. So, if the content requires 100px, then the column's width should be set to 100px, and the remaining columns should fill up the available space.
I attempted to use the col-auto
class on the first column in the HTML table, but unfortunately, it didn't have the desired effect.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0b6964647f787f796a7b4b3f253e2538">[email protected]</a>/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<table class="table table-striped">
<tbody>
<tr>
<td class="col-auto">First Column</td>
<td>Second Column</td>
</tr>
</tbody>
</table>
Any suggestions on how I can adjust the first column to match the size of its content?