Bootstrap Table Striped: How Do I Change The Stripe Background Colour?


Answer :

Add the following CSS style after loading Bootstrap:

.table-striped>tbody>tr:nth-child(odd)>td,  .table-striped>tbody>tr:nth-child(odd)>th {    background-color: red; // Choose your own color here  } 

.table-striped > tbody > tr:nth-child(2n+1) > td, .table-striped > tbody > tr:nth-child(2n+1) > th {    background-color: red; } 

change this line in bootstrap.css or you could use (odd) or (even) instead of (2n+1)


If you are using Bootstrap 3, you can use Florin's method, or use a custom CSS file.

If you use Bootstrap less source instead of processed css files, you can directly change it in bootstrap/less/variables.less.

Find something like:

//** Background color used for `.table-striped`. @table-bg-accent:               #f9f9f9; 

Comments

Popular posts from this blog

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Can Feynman Diagrams Be Used To Represent Any Perturbation Theory?