PDA

View Full Version : CSS parent/child and tables


Cherubae
02-05-2003, 07:40 PM
I'm hoping to find a work around for Internet Explorer and trying to get it to recognize a parent/child css declaration.

I have a table that lists some data. I have it set up so that any td tags that appear within a table class have specific css attributes. It works just fine in Opera 5, but when I try it with IE it doesn't work...

- - - - - - - -
.tableprice {border: 1px solid #28B890; font-family: verdana, sans-serif; color:#000000; font-size:10px;}
table.tableprice > tr > td {border-top: 1px solid #28B890; font-family: verdana, sans-serif; color:#000000; font-size:10px; text-align:left;}
- - - - - - - -

In order to get IE to display what I want, I had to create a seperate class for the td tag.

- - - - - - - -
td.price {border-top: 1px solid #28B890; font-family: verdana, sans-serif; color:#000000; font-size:10px; text-align:left;}
- - - - - - - -

Now at every TD tag in my table I have to add the class="price" css. Kinda pain in the rear when I know it works just the same way without all the extra css tags.

Online page -> http://www.fogu.com/rk3/items.htm
The first table to the left has the first two tr tags with the class=price while the rest are empty except for the top table class=tableprice .

ideas?


- Cher

meow
02-05-2003, 07:48 PM
Wouldn't a contextual selector do?

table.tableprice td {}

Cherubae
02-05-2003, 08:03 PM
Yes, that it would work :thumbsup: Thanks! Everything is happy in css land again


- Cher