Bootstrap tables cells (td, th) have a default padding of 8px. What's a good way to change it to another value for all bootstrap tables?
I am assuming your are talking about the bootstrap pre-defined tables and not the grid system. If you want to change all the padding
elements on one specific table you can do something like this in your html:
EDIT I switched the code because the other code was not working.
Try this CSS:
.mytable>tbody>tr>td, .mytable>tbody>tr>th, .mytable>tfoot>tr>td, .mytable>tfoot>tr>th, .mytable>thead>tr>td, .mytable>thead>tr>th {
padding: 12px;
}
Add this class to your table
<table class="table mytable">
table data here...
</table>
Here is the JS Fiddle here. There are a few other ways to do this like using the !important
to over ride other CSS classes but I don't recommend it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With