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 8430689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:39:22+00:00 2026-06-10T05:39:22+00:00

I Am Having Css code for differentiating odd and even row by different color

  • 0

I Am Having Css code for differentiating odd and even row by different color

.historyLog tr:nth-child(odd) td {
background-color:blue;
}
.historyLog tr.odd td{
    background-color: blue;
}
​
.historyLog tr:nth-child(even) td {
background-color:orange;
}
.historyLog tr.even td{
    background-color: orange;
}

And having table with class .historyLog

<table class="historyLog">
<tr><td></td></tr>
<tr><td></td></tr>
</table>

Problem with me is that when I apply Css using the class attribute .historyLog i.ie

.historyLog tr:nth-child(odd) td {
background-color:blue;
}

The IE8 does’t execute it and what I will get is same color for all rows whether even or odd. But if I apply css without using the class attribute of table i.e

tr:nth-child(odd) td {
background-color:blue;
}

then IE8 execute it in odd even row with different color.
Please help me by giving the answer that how IE8 will show odd and even row by different color using the class attribute of table.

  • 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-06-10T05:39:24+00:00Added an answer on June 10, 2026 at 5:39 am

    Since IE8 doesnot support CSS3 selectors. You could very well use jQuery’s in built in :odd or :even selectors to achieve the same functionality.

    $(".historyLog tr:odd").css('background-color','blue');
    $(".historyLog tr:even").css('background-color','white');
    

    or you could use css class file instead

    $(".historyLog tr:odd").addClass("odd");
    $(".historyLog tr:even").addClass("even");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following is my CSS code: <style type=text/css> body { background-color:#FFF; font-weight:bold; font-size:12pt; font-family:Arial,sans-serif;
I'm having trouble writing maintainable CSS code when font size is specified with EM
I'm having troubles with the following code: <link type=text/css href=http://jqueryui.com/latest/themes/base/jquery.ui.all.css rel=stylesheet /> <script type=text/javascript
In my html table I have two row, first row having no css but
I'm having a design/css issue. I'm using Twitter Bootstrap and have a .row-fluid, with
I have the jsf code and css code below. I'm having trouble getting the
It looks like I am having a css problem in IE 8. The code
I'm having an annoying rendering issue with IE my code is CSS : div
In the following HTML/CSS code I'm having two issues: The result class boxes have
I'm having css specificity issues. I want the <td> style to be colored different

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.