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

  • Home
  • SEARCH
  • 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 7699085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:23:45+00:00 2026-05-31T22:23:45+00:00

I have a table with rows of alternating colors, e.g.: <table> <tr class=even><td></td><td></td></tr> <tr

  • 0

I have a table with rows of alternating colors, e.g.:

<table>
  <tr class="even"><td></td><td></td></tr>
  <tr class="odd"> <td></td><td></td></tr>
  <tr class="even"><td></td><td></td></tr>
  <tr class="odd"> <td></td><td></td></tr>  
</table>

I want to highlight a bunch of the table cells, but in a different way if the cell is in an even or an odd row, as multiple vertically-stacked cells might be highlighted and I want to maintain the alteration of row color. What I first came up with was to just create two classes, highlight_even and highlight_odd, figure out in my javascript code (as this highlighting will be done dynamically) whether the row is even or odd, and set class accordingly, e.g.:

<table>
  <tr class="even"><td></td><td class="highlight_even"></td></tr>
  <tr class="odd"> <td></td><td class="highlight_odd"></td></tr>
  <tr class="even"><td></td><td></td></tr>
  <tr class="odd"> <td></td><td></td class="highlight_odd"></tr>  
</table>

The colors are very straightforward, though. I want to make highlight_even by blending green into the even color, and highlight_odd by blending the same green into the odd color. Is there any way to accomplish that in css, such that that same highlighted table could just look like this?

<table>
  <tr class="even"><td></td><td class="highlight"></td></tr>
  <tr class="odd"> <td></td><td class="highlight"></td></tr>
  <tr class="even"><td></td><td></td></tr>
  <tr class="odd"> <td></td><td></td class="highlight"></tr>  
</table>

Something like (in pseudocode):

td.highlight {
    background-color: blend #ff0 into existing background-color;
}
  • 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-31T22:23:47+00:00Added an answer on May 31, 2026 at 10:23 pm

    Why not just define the blending manually? You shouldn’t need multiple highlight_* classes to do this, either. Assuming even rows are #ff0 and odd rows are #f0f and a plain white highlight:

    tr.even td.highlight { background: #ff8; }
    tr.odd td.highlight { background: #f8f; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to add alternating colors to rows in a table, but instead of
I'm trying to display table rows with alternating colors. For that, I have two
I have table with few rows, after use hover mouse over row I want
I have a table with rows of height 90. I want to have an
I have table in which I am inserting rows for employee but next time
I am trying to make the rows of a table have a highlight color
I have created a table having rows with alternating colours(say yellow and red). Now,
I have the following script working to add odd and even classes to alternating
The following script helps to make html tables to have rows of alternating colors:
I have a table of rows holding four different fields of numbers: people, debris,

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.