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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:11:17+00:00 2026-05-24T17:11:17+00:00

I have a problem with styling a single table cell. Here is an example

  • 0

I have a problem with styling a single table cell. Here is an example code illustrating my problem:

<style>
#bltable { border-collapse:collapse; width:575px;
    -moz-user-select:none;}
#bltable tr.row1 {background-color:#eff3f7;}
#bltable tr.row2 {background-color:#ffffff;}
#bltable tr.fotm td {background-color:#ffffd9;}
#bltable td.op td {background-color:#f2f2c3;}
</style>
<table id="bloodlines">
    <tr class="row1">
        <th>1</th>
        <th>2</th>
        <th>3</th>
        <th>4</th>
    </tr>
        <tr class="row2">
        <td>sup</td>
        <td>sup</td>
        <td class="op">sup</td>
        <td>sup</td>
    </tr>
    <tr class="fotm">
        <td>sup</td>
        <td>sup</td>
        <td>sup</td>
        <td>sup</td>
    </tr>
</table>

As you can see the table has two main colours (row1 and row2) that change each row (checkboard style).
The table also has a “flavour of the month” row with an additional third color.
Lastly the table has a single td class=”op” that will be a fourth color.

The problem I’m having is that row1, row2 and the fotm class overrides the “op” class color and the fourth color is not shown. Can I write this any differently to make it work?

I’ve tried:

#bltable tr.row1 

(without “td” in the end) but then I get no row color at all, seeing as “X is not inherited. It is applied to an enclosing tag”

Furthermore, Im not sure wether its necessary to have the extra “td” at the end of

#bltable td.op td {}

given that td.op should take care of that part.. In principle shouldn’t only

.op {}

be enough?

Any ideas?

  • 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-24T17:11:18+00:00Added an answer on May 24, 2026 at 5:11 pm

    You need to change this line in your css

    #bltable td.op td {background-color:#f2f2c3;}

    to this

    #bltable tr td.op {background-color:#f2f2c3;}

    You had two tds and the .op on the first.

    Example: http://jsfiddle.net/jasongennaro/LdSM3/

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

Sidebar

Related Questions

I'm having a problem while trying to dynamically change a table cell's styling class
I have a problem with asp:button styling. I added following style: .myAspButton { background-image:
I have a problem styling/templating an AccordionItem in the accordion control from the silverlight
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have a set of anchors like <a class=lb href=#>text</a> <a class=lb href=# style=width:200px>text</a>
I have a problem styling my form. Everything works fine except the checkboxes. They
I have a very specific problem. I have a user control (code below) That
I'm styling a form by using a table with fixed-width columns and I want
I have a rich:modalPanel which I am styling from external css, But the problem
I have problem in some JavaScript that I am writing where the Switch statement

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.