How do you change the default boot table cells?

Boot table cells (td, th) have a default padding of 8px. What is a good way to change it to a different value for all boot tables?

+4
source share
1 answer

I assume that you are talking about predefined bootstrap tables, not a grid. If you want to change all the elements paddingon one specific table, you can do something like this in your html:

EDIT I ​​switched the code because the other code did not work.

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 the table.

<table class="table mytable">
   table data here...
</table>

JS. , , !important CSS, .

+5

All Articles