I'm trying to add row shading to my theme. If I add

tr.odd td, tr.even td {
  background-color: #eee;
  padding: 0.3em;
}

No effect. If I put this directly on the page:

<tr style='background-color:#eee;'><td style='background-color:#eee;'>cell conents</td><td style='background-color:#eee;'>cell conents</td></tr>

No effect.

Isn't specifying "sytle=" directly in the page supposed to override any style sheet included? How could this have no effect. I'm completely baffled. Any help is much appreciated.

Comments

timeril’s picture

In your first example it looks like you are shading odd AND even rows with the same background color. Are you trying to alternate?

To find out if your style is being overridden by some other style, change your td tags to

style="background-color:#eee !important;"

If that STILL doesn't work, you have a more complicated issue.

anner’s picture

I was alternating, I was labeling my odd rows, but not my even. So one should have been shaded and not the other. Your example here didn't work either. The attempt is much appreciated.

I don't understand why. All other style elements are working fine. Even table header background color and tr borders and padding. Ideas?

timeril’s picture

Can you post a snippet of the code that's being rendered in the browser? Maybe the whole table?

anner’s picture

Here are some examples of the source it produces:
If I use style='background-color:#eee !important;'

<br>
<table align="center" border="1" cellpadding="4">
<tbody><tr><th class="subheadBoxLtBlue">Manage List</th><th class="subheadBoxLtBlue">View List Membership</th><th class="subheadBoxLtBlue">List Owners</th><th class="subheadBoxLtBlue">List Group</th></tr>

<tr><td><a href="http://server.name/mailman/admin/test.anne3" target="_blank">test.anne3@server.name </a></td><td><a href="http://server.name/mailman/roster/test.anne3" target="_blank">test.anne3 Membership</a></td><td>address@ncmail.net, </td><td>demo.server.grp</td><td><form action="function.php" method="post"><input name="ListName" value="test.anne3" type="hidden"><input name="Group" value="demo.server.grp" type="hidden"><input name="DeleteList" value="Delete test.anne3" type="submit"></form></td></tr>

<tr style="background-color: rgb(238, 238, 238) ! important;"><td style="background-color: rgb(238, 238, 238) ! important;"><a href="http://server.name/mailman/admin/test.anne4" target="_blank">test.anne4@server.name </a></td><td style="background-color: rgb(238, 238, 238) ! important;"><a href="http://server.name/mailman/roster/test.anne4" target="_blank">test.anne4 Membership</a></td><td style="background-color: rgb(238, 238, 238) ! important;">test@ncmail.net, </td><td>demo.server.grp</td><td><form action="function.php" method="post"><input name="ListName" value="test.anne4" type="hidden"><input name="Group" value="demo.server.grp" type="hidden"><input name="DeleteList" value="Delete test.anne4" type="submit"></form></td></tr>
</tbody></table>

or if I use class='odd'

<br>
<table align="center" border="1" cellpadding="4">
<tbody><tr><th class="subheadBoxLtBlue">Manage List</th><th class="subheadBoxLtBlue">View List Membership</th><th class="subheadBoxLtBlue">List Owners</th><th class="subheadBoxLtBlue">List Group</th></tr>

<tr><td><a href="http://server.name/mailman/admin/test.anne3" target="_blank">test.anne3@server.name </a></td><td><a href="http://server.name/mailman/roster/test.anne3" target="_blank">test.anne3 Membership</a></td><td>address@ncmail.net, </td><td>demo.server.grp</td><td><form action="function.php" method="post"><input name="ListName" value="test.anne3" type="hidden"><input name="Group" value="demo.server.grp" type="hidden"><input name="DeleteList" value="Delete test.anne3" type="submit"></form></td></tr>

<tr class="odd"><td class="odd"><a href="http://server.name/mailman/admin/test.anne4" target="_blank">test.anne4@server.name </a></td><td class="odd"><a href="http://server.name/mailman/roster/test.anne4" target="_blank">test.anne4 Membership</a></td><td class="odd">address@ncmail.net, </td><td>demo.server.grp</td><td><form action="function.php" method="post"><input name="ListName" value="test.anne4" type="hidden"><input name="Group" value="demo.server.grp" type="hidden"><input name="DeleteList" value="Delete test.anne4" type="submit"></form></td></tr>
</tbody></table>

Nothing seems to make a difference to how it is shown.

timeril’s picture

Hmm - I pasted style="background-color: rgb(238, 238, 238) ! important;" into a td tag and it worked fine. Want to email me your stylesheet and HTML?

anner’s picture

ARG! You say that and I think....hmmm, let me check something....it works on windows, but not on my firefox under linux (which is what my desktop is). Dang!

Jeez, and it appears to be only my firefox...the other linux desktops here running both firefox 1 and 2 are fine. Not my day. Thank you so much for your help.

timeril’s picture

You're welcome - maybe you have some strange settings in your browser? Or even your screen? I want to know the answer! :)

Michelle’s picture

Maybe it's the tds in there causing the problem? This is what I have and it works:

tr.odd {
  border-bottom: 1px solid #061E8D;
  background-color: #BFCAFF;
  }

tr.even {
  border-bottom: 1px solid #061E8D;
  background-color: white;
  }

Michelle

--------------------------------------
My site: http://shellmultimedia.com

anner’s picture

I tried that in the code above, same results.