Hi,
I have a table but i want to make the cells size fit to content. how to do that?
<style type="text/css">
.table tr.fit,
.table td.fit,
.table th.fit {
white-space: nowrap;
width: 1%;
}
</style>
<table class="table table-striped table-sm">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Loan Type</th>
<th scope="col">Original Loan Amount</th>
<th scope="col">Amount Left</th>
<th scope="col">More Details</th>
</tr>
</thead>
<tbody>
{% for loan in loans %}
<tr>
<th scope="row">{{ forloop.counter }}</th>
<td>{{loan.loan_type}}</td>
<td>{{loan.original_loan_amount|intcomma}} AED</td>
<td style= 'background-color:lightgreen'><b>{{loan.loan_amount_left|intcomma}} AED</b></td>
<td><a class="btn btn-sm btn-info" href="{% url 'loan_details' loan.id %}">Details...</a></td>
{% endfor %}
</tr>
<td colspan="3" align="right"><b>Total Amount Due:</b></td>
<td colspan="3" align="left"><b>{{total_price1|intcomma}} AED</b></td>
</tbody>
</table>
I still get the spaces: