Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bootstrap reduce row padding

I am using Bootstrap 3.x with a table definition like this

<table class="table table-hover table-condensed table-striped table-bordered">

Pretty standard stuff

I want to reduce the default vertical padding on the cells - want to reduce the padding on cells further. I know that table-condensed reduces the vertical padding by 50%. I want to reduce it to just 1px.

Where do I make the change? I have tried going through bootstrap.min.css but can't find anything to modify there - nothing I understand

Many thanks in advance

Best wishes

Iyer

like image 627
K Y Iyer Avatar asked May 08 '14 11:05

K Y Iyer


People also ask

How do I reduce spacing between rows?

Change the line spacing in a portion of the document Select the paragraphs you want to change. Go to Home > Line and Paragraph Spacing. Choose the number of line spaces you want or select Line Spacing Options, and then select the options you want under Spacing.

How do you gap a row in Bootstrap?

If you need to separate rows in bootstrap, you can simply use . form-group . This adds 15px margin to the bottom of row.

How do I reduce the gutter space in Bootstrap?

By default, Bootstrap 4 has class=”no-gutters” to remove gutter spaces of any specific div. The following image shows the highlighted gutter space and space between columns on bootstrap 4 12 column grid system. You can even modify gutter width by reducing 15px width of gutter space between each columns.

What is $spacer in Bootstrap?

$spacer is a SASS variable. By default it's value is 1rem . Therefore mt-1 is margin-top:. 25rem; The value for each of the 6 spacing units (0-5) are derived from the $spacers SASS map variable...


1 Answers

It's pretty easy if you know how to use inspector tool of your browser (Right click->Inspect Element). If you want to learn CSS this would be a very important tool.

So find this property:

.table-condensed>thead>tr>th, .table-condensed>tbody>tr>th, .table-condensed>tfoot>tr>th, .table-condensed>thead>tr>td, .table-condensed>tbody>tr>td, .table-condensed>tfoot>tr>td{
    padding: 5px;
}

which has padding: 5px;, change it to 1px.

Here's how it looks when changed.

like image 142
AyB Avatar answered Sep 28 '22 21:09

AyB