Reputation: 20150
I am trying to make bootstrap table as small as possible but based on the solutions of other questions, it is not working. I have tried width:auto !important
or table-layout:auto !important
but it is not working. Below is a sample of my table
Upvotes: 6
Views: 21891
Reputation: 160
Though question is old but what I do to achieve this may help someone else. First you did not state version of bootstrap you are using. My solution worked for version four.
<table class="table table-hover table-responsive table-sm">
......
</table>
Adding class responsive and sm did the magic for me the table in my went as low as to the content
Upvotes: 16
Reputation: 330
Place the table inside a div and give width to that div. Aldo try to specify the width for td.
Upvotes: 0
Reputation: 1534
Have you tried to specify special width
for your rows or set width o table to current value?
Upvotes: 0