Change the color of the individual rows of the break table

I do not want to change the color of individual rows in a striped table using jQuery:

$("#rowElementId").addClass("activeRow");

The css class is activeRowas follows:

.activeRow {
background-color: #d9d9d9;
}

The table itself looks like this:

<table class="table table-striped">
    <thead>
        <tr id=...>
        ...

The problem is that my solution, the jQuery instruction, only works for white lines in a striped table. How can i change this?

Here you can find an example of my problem: Bootstrap

+4
source share
2 answers

Specificity is disabled. Color Selector current line next to the bootstrap 3: .table-striped>tbody>tr:nth-of-type(odd).

You should make your style so as to increase its specificity:

.table-striped>tbody>tr.activeRow{
    background-color: #d9d9d9;
}

: bootply, . ( )

+5

!important ,

.activeRow {
  background-color: #d9d9d9 !important;
}
+1

All Articles