I have the following code:
.gastos {
width: 50px;
white-space: nowrap;
}
.titulos_egresos {
width: 300px;
white-space: nowrap;
}
<table class="table table-bordered border-dark table-sm">
<thead>
<tr class="table-active">
<th scope="col">
<h5 class="text-center titulos_egresos">1. Detalle de sueldos y cargas sociales</h5>
</th>
<th scope="col">
<h5 class="text-center gastos">Gastos A</h5>
</th>
<th scope="col">
<h5 class="text-center gastos">Gastos B</h5>
</th>
<th scope="col">
<h5 class="text-center gastos">Gastos C</h5>
</th>
<th scope="col">
<h5 class="text-center gastos">Gastos D</h5>
</th>
<th scope="col">
<h5 class="text-center gastos">Total</h5>
</th>
</tr>
</thead>
<tbody>
<!--For each gastos A-->
{{#each gastos_a}}
<tr class="">
<td> {{titulo}}</td>
<td class="">${{monto_parcial}}</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<table>
My problem is that my column's width is adjusting to the content of the cells. If the content is too large, the column will grow to contain it, even though I've set a class with a width of 50 or 300px. How can I avoid this?