Page 1 of 1

Hover table rows but still keep background color of some cel

Posted: Tue Sep 20, 2016 12:13 pm
by sarojthapa60
Some cells on my table have background colors. The table's row colors are alternating. I created a hover in table row. When the mouse is over a row, it hovers and all the background colors of some colorful cells are invisible. How can I hover but still keep the background?

CSS:

Code: Select all

tr:hover td,
tr.even:hover td.active,
tr.odd:hover td.active {
background-color: #EBEBEB ;
}
JQuery:

Code: Select all

$(document).ready(function()
    {
        $("tr:odd").css("background-color", "#dfe7f2");        
    });

Re: Hover table rows but still keep background color of some

Posted: Tue Sep 20, 2016 10:46 pm
by Christopher
Please provide the HTML of the table too.

Re: Hover table rows but still keep background color of some

Posted: Wed Sep 21, 2016 6:44 am
by Celauran
Why are you setting some rules in CSS and others in JS?