Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7508345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:39:52+00:00 2026-05-29T22:39:52+00:00

Been scouring the net for the ‘best’ way to do table row highlighting. Seems

  • 0

Been scouring the net for the ‘best’ way to do table row highlighting.

Seems that the two main alternatives are:

1 Pure CSS: tr:hover

2 Css + Jquery:

$("table").delegate('td','mouseover mouseleave', function(e) {
  if (e.type == 'mouseover') {
    $(this).parent().addClass("tr-hover");
  }
  else {
    $(this).parent().removeClass("tr-hover");
  }
});

I have no idea what is considered best practise these days. As far as I can ascertain, its only IE7 that doesn’t work properly with the Pure CSS option.

Or, are there other alternatives that I should consider?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T22:39:53+00:00Added an answer on May 29, 2026 at 10:39 pm

    Use the CSS :hover method. It does also work in IE7+, provided that a DOCTYPE is set. This statement is backed-up by this MSDN article.

    … improve CSS2.1 compliance. All this work (with the exception of transparent PNGs) has been done under the <!DOCTYPE> switch only, since all changes required behavioral updates to be more in line what the CSS spec specifies.

      . . .
    We also extended our existing implementations to comply with W3C specifications:

    • Enable :hover on all elements not just on <a>

    According to personal tests (and by this source), standards-compliant mode is not activated when:

    • No DOCTYPE is set
      or when the DOCTYPE is set, and:
    • A versionless HTML is specified.
    • A HTML version lower than 4.x is specified (including non-existent lower versions, such as 3.99)
    • HTML 4 is specified (instead of 4.x) without URL. http:// is also valid, other protocols are invalid.
    • HTML 4.x Transitional or HTML 4.x Frameset without an URL part.

    It is activated with all other DOCTYPEs, including XHTML, XML, and unknown ones.


    Pros for CSS:

    • It’s much more efficient than jQuery: no event listeners are involved, the behaviour is defined right after the definition of the CSS rule (jQuery requires the library and a function call).
    • It also works when JavaScript is disabled.

    Pros for jQuery:

    • It also works in IE6-
      (this markup is not that critical, so this would not have a big weight. Who is using IE6 by the way?).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been scouring the web for a code sample that shows how to
I've been scouring for documentation on the REST adapter that is packaged with ember
I've been scouring the net and i have found nothing! I am using symfonys
Possible Duplicate: Why catch and rethrow Exception in C#? I've been scouring the net
I've been scouring both this site and the net in general for an example
I'm very new to MVC, and so I've been scouring the net in an
Been scouring the internet looking for documentation that gives a list of acceptable strings
I have been scouring the net but I can't seem to find any examples
I've been scouring the web for a way to do this. I want to
Iv been scouring the net looking for a simple lookup thesaurus to import into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.