Hover table rows but still keep background color of some cel

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
sarojthapa60
Forum Newbie
Posts: 8
Joined: Sun Sep 11, 2016 9:36 pm

Hover table rows but still keep background color of some cel

Post 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");        
    });
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

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

Post by Christopher »

Please provide the HTML of the table too.
(#10850)
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

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

Post by Celauran »

Why are you setting some rules in CSS and others in JS?
Post Reply