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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:19:49+00:00 2026-06-17T07:19:49+00:00

I have a table that I currently do zebra striping on with the rows,

  • 0

I have a table that I currently do zebra striping on with the rows, even and odd which works fine. My problem is that I also have a class that is used to indicate the new rows which a different color style. It seems that this new class is being over thrown by the zebra stripe CSS, is there a way around this? Any tips or suggestions appreciated, thanks.

Here is a bit of CSS that controls this table

   #table tbody tr:nth-child(odd){
    background-color: #cccccc; color:black;
     }
   #table tbody tr:nth-child(even){
   background: #EBEBEB; color: #7D7D7D;
    }
   #table tbody tr:nth-child(2n+1):hover{
        cursor:pointer;
        /* add gradient */
        background-color: #808080;
        background: -webkit-gradient(linear, left top, left bottom, from(#909090), to(#606060));
        background: -moz-linear-gradient(top, #909090, #606060);
        color: #dadada;
        font-weight: ;
    }
  #table tbody tr:nth-child(2n):hover{
        cursor:pointer;
        /* add gradient */
        background-color: #808080;
        background: -webkit-gradient(linear, left top, left bottom, from(#909090),        to(#606060));
        background: -moz-linear-gradient(top, #909090, #606060);
        color: #dadada;

    }
  .new {
    background-color: #760086;
    color:white;
       }
  • 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-17T07:19:50+00:00Added an answer on June 17, 2026 at 7:19 am

    If you put the CSS for the zebra-stripping rows before the codes for the newly created elements, then it should be just fine:

    p:nth-child(2n+1){
        /*blah*/
    }
    p:nth-child(2n){
        /*blah*/
    }
    p.new{
        /*blah*/
    }
    

    Live demo: http://jsfiddle.net/DerekL/ZFcKs/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this table that is currently 1200+ rows, of which these rows have
I have a table that has an AUTO_INCREMENT field. Currently, it is also a
I currently have a table that exists which I'm able to pull data from.
I currently have a table that can be N columns and N rows. In
Currently, I have a table that has a column which has a datatype enum.
I'm trying to normalize a mysql database.... I currently have a table that contains
I currently have a table structure that looks something like this(some details omitted): ColumnName
Currently I have a User table that has a toys_owned column that is an
So currently I have a table in Lua that contains another table (much like
I currently have a table with an id column that is being autoincremented and

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.