HighDots Forums  

row background

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss row background in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mike
 
Posts: n/a

Default row background - 01-13-2009 , 03:51 PM






Hello,
I am trying to set row background colors, but I can only set them in
the td's .
If I set them with a class in the tr they dont render.
What am I doing wrong?
Thanks
Mike

Reply With Quote
  #2  
Old   
John Hosking
 
Posts: n/a

Default Re: row background - 01-13-2009 , 03:58 PM






Mike wrote:
Quote:
I am trying to set row background colors, but I can only set them in
the td's .
If I set them with a class in the tr they dont render.
What am I doing wrong?
I don't know; your code looks okay to me.

Ha ha, just kidding. How about providing a URL for us to look at?


--
John
Possessive "its" has no apostrophe. Even on the Internet.


Reply With Quote
  #3  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: row background - 01-13-2009 , 04:02 PM



Mike wrote:

Quote:
I am trying to set row background colors, but I can only set them in
the td's .
No, you can also set them for th's and tr's and thead's and tbody's.

Quote:
If I set them with a class in the tr they dont render.
Really? Exactly what did you try?

Quote:
What am I doing wrong?
You're not posting a URL that shows what you really tried.

--
Yucca, http://www.cs.tut.fi/~jkorpela/


Reply With Quote
  #4  
Old   
Bergamot
 
Posts: n/a

Default Re: row background - 01-13-2009 , 04:21 PM




Mike wrote:
Quote:
I am trying to set row background colors, but I can only set them in
the td's .
If I set them with a class in the tr they dont render.
Put the class on the tr and use descendant selectors to apply the color
to the td's in that row.

tr.alternate td {background:#ccc; color:#000}

--
Berg


Reply With Quote
  #5  
Old   
Nik Coughlin
 
Posts: n/a

Default Re: row background - 01-13-2009 , 04:23 PM



"Mike" <ampeloso (AT) gmail (DOT) com> wrote

Quote:
Hello,
I am trying to set row background colors, but I can only set them in
the td's .
If I set them with a class in the tr they dont render.
What am I doing wrong?
Not showing us an URL where you've uploaded a demo page showing what you've
tried so we can see what your problem actually is?

That said, most likely the answer is that instead of this:

<tr class="rowClass">
<td>...</td>
</tr>

..rowClass {
background-color: #fff;
}

you should try:

..rowClass td {
background-color: #fff;
}



Reply With Quote
  #6  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: row background - 01-13-2009 , 04:44 PM



Bergamot wrote:

Quote:
If I set them with a class in the tr they dont render.

Put the class on the tr and use descendant selectors to apply the
color to the td's in that row.
And th's?

But why? If you set background for tr, then this background will shine
through in the cells, if they have the default background setting,
transparent. If this is not the case, there is something special that
prevents that.

--
Yucca, http://www.cs.tut.fi/~jkorpela/



Reply With Quote
  #7  
Old   
Nik Coughlin
 
Posts: n/a

Default Re: row background - 01-13-2009 , 05:01 PM



"Jukka K. Korpela" <jkorpela (AT) cs (DOT) tut.fi> wrote

Quote:
But why? If you set background for tr, then this background will shine
through in the cells, if they have the default background setting,
transparent. If this is not the case, there is something special that
prevents that.
I seem to recall that some user agents wouldn't apply a background to tds by
setting it on the tr directly, but on actually checking this, it appears
that even fairly antiquated browsers do.



Reply With Quote
  #8  
Old   
Mike
 
Posts: n/a

Default Re: row background - 01-13-2009 , 06:08 PM



On Jan 13, 5:01*pm, "Nik Coughlin" <nrkn.... (AT) gmail (DOT) com> wrote:
Quote:
"Jukka K. Korpela" <jkorp... (AT) cs (DOT) tut.fi> wrote in messagenews:jX7bl.118652$_03.109122 (AT) reader1 (DOT) news.saunalahti.fi...



But why? If you set background for tr, then this background will shine
through in the cells, if they have the default background setting,
transparent. If this is not the case, there is something special that
prevents that.

I seem to recall that some user agents wouldn't apply a background to tdsby
setting it on the tr directly, but on actually checking this, it appears
that even fairly antiquated browsers do.
Unfortunatly its part of a form and Database form and I dont need
anyone messing with it.
But here is a snippet:
<tr class="color1"></tr>
<td ><a href="http://www.xxxxxxt.com/TELS/AddUser.php?
OP=Delete&Netid=noone"><img src="garbage.jpg" border="0" width="24"
height="24" alt="Symbols-Delete-icon.JPG (892 bytes)"></a></td>
<td >noone</td>
<td >noone</td>
<td > Mike</td>
<td > Peloso</td>
<td > AU</td>
<td > Lu</td>
<td > 25.00</td>

</tr>



<tr class="color2"></tr>
<td ><a href="http://www.xxxxxxt.com/TELS/AddUser.php?
OP=Delete&Netid=fsaf"><img src="garbage.jpg" border="0" width="24"
height="24" alt="Symbols-Delete-icon.JPG (892 bytes)"></a></td>
<td >fsaf</td>
<td >fsaf</td>
<td > sdfsdf</td>
<td > sdfsf</td>
<td > sdf</td>
<td > sdfsad</td>
<td > 25.00</td>

</tr>



<tr class="color1"></tr>
<td ><a href="http://www.xxxxxx.com/TELS/AddUser.php?
OP=Delete&Netid=efdwfe"><img src="garbage.jpg" border="0" width="24"
height="24" alt="Symbols-Delete-icon.JPG (892 bytes)"></a></td>
<td >efdwfe</td>
<td >efdwfe</td>
<td > Mike</td>
<td > Peloso</td>
<td > RU</td>
<td > Lu</td>
<td > 25.00</td>

</tr>



<tr class="color2"></tr>
<td ><a href="http://www.xxxxxx.com/TELS/AddUser.php?
OP=Delete&Netid=mpeloso"><img src="garbage.jpg" border="0" width="24"
height="24" alt="Symbols-Delete-icon.JPG (892 bytes)"></a></td>
<td >mpeloso</td>
<td >mpeloso</td>
<td > Mike</td>
<td > Peloso</td>
<td > RU</td>
<td > Lu</td>
<td > 25.00</td>

</tr>

The CSS:
..color1{
background: #CCFFCC;
}
..color2{
background:#BFD8BC;
}


Reply With Quote
  #9  
Old   
Mark Hansen
 
Posts: n/a

Default Re: row background - 01-13-2009 , 06:12 PM



On 01/13/09 15:08, Mike wrote:
Quote:
On Jan 13, 5:01�pm, "Nik Coughlin" <nrkn.... (AT) gmail (DOT) com> wrote:
"Jukka K. Korpela" <jkorp... (AT) cs (DOT) tut.fi> wrote in messagenews:jX7bl.118652$_03.109122 (AT) reader1 (DOT) news.saunalahti.fi...



But why? If you set background for tr, then this background will shine
through in the cells, if they have the default background setting,
transparent. If this is not the case, there is something special that
prevents that.

I seem to recall that some user agents wouldn't apply a background to tds by
setting it on the tr directly, but on actually checking this, it appears
that even fairly antiquated browsers do.

Unfortunatly its part of a form and Database form and I dont need
anyone messing with it.
But here is a snippet:
tr class="color1"></tr
It looks like you're terminating your "tr" elements before adding in the
"td" elements.

Quote:
td ><a href="http://www.xxxxxxt.com/TELS/AddUser.php?
OP=Delete&Netid=noone"><img src="garbage.jpg" border="0" width="24"
height="24" alt="Symbols-Delete-icon.JPG (892 bytes)"></a></td
td >noone</td
td >noone</td
td > Mike</td
td > Peloso</td
td > AU</td
td > Lu</td
td > 25.00</td

/tr



tr class="color2"></tr
td ><a href="http://www.xxxxxxt.com/TELS/AddUser.php?
OP=Delete&Netid=fsaf"><img src="garbage.jpg" border="0" width="24"
height="24" alt="Symbols-Delete-icon.JPG (892 bytes)"></a></td
td >fsaf</td
td >fsaf</td
td > sdfsdf</td
td > sdfsf</td
td > sdf</td
td > sdfsad</td
td > 25.00</td

/tr



tr class="color1"></tr
td ><a href="http://www.xxxxxx.com/TELS/AddUser.php?
OP=Delete&Netid=efdwfe"><img src="garbage.jpg" border="0" width="24"
height="24" alt="Symbols-Delete-icon.JPG (892 bytes)"></a></td
td >efdwfe</td
td >efdwfe</td
td > Mike</td
td > Peloso</td
td > RU</td
td > Lu</td
td > 25.00</td

/tr



tr class="color2"></tr
td ><a href="http://www.xxxxxx.com/TELS/AddUser.php?
OP=Delete&Netid=mpeloso"><img src="garbage.jpg" border="0" width="24"
height="24" alt="Symbols-Delete-icon.JPG (892 bytes)"></a></td
td >mpeloso</td
td >mpeloso</td
td > Mike</td
td > Peloso</td
td > RU</td
td > Lu</td
td > 25.00</td

/tr

The CSS:
.color1{
background: #CCFFCC;
}
.color2{
background:#BFD8BC;
}



Reply With Quote
  #10  
Old   
Mike
 
Posts: n/a

Default Re: row background - 01-13-2009 , 06:21 PM



On Jan 13, 6:12*pm, Mark Hansen <m... (AT) NOSPAMwinfirst (DOT) com> wrote:
Quote:
On 01/13/09 15:08, Mike wrote:





On Jan 13, 5:01 pm, "Nik Coughlin" <nrkn.... (AT) gmail (DOT) com> wrote:
"Jukka K. Korpela" <jkorp... (AT) cs (DOT) tut.fi> wrote in messagenews:jX7bl.118652$_03.109122 (AT) reader1 (DOT) news.saunalahti.fi...

But why? If you set background for tr, then this background will shine
through in the cells, if they have the default background setting,
transparent. If this is not the case, there is something special that
prevents that.

I seem to recall that some user agents wouldn't apply a background to tds by
setting it on the tr directly, but on actually checking this, it appears
that even fairly antiquated browsers do.

Unfortunatly its part of a form and Database form and I dont need
anyone messing with it.
But here is a snippet:
tr class="color1"></tr

It looks like you're terminating your "tr" elements before adding in the
"td" elements.



td ><a href="http://www.xxxxxxt.com/TELS/AddUser.php?
OP=Delete&Netid=noone"><img src="garbage.jpg" border="0" width="24"
height="24" alt="Symbols-Delete-icon.JPG (892 bytes)"></a></td
td >noone</td
td >noone</td
td > Mike</td
td *> Peloso</td
td > AU</td
td > Lu</td
td > 25.00</td

/tr

tr class="color2"></tr
td ><a href="http://www.xxxxxxt.com/TELS/AddUser.php?
OP=Delete&Netid=fsaf"><img src="garbage.jpg" border="0" width="24"
height="24" alt="Symbols-Delete-icon.JPG (892 bytes)"></a></td
td >fsaf</td
td >fsaf</td
td > sdfsdf</td
td *> sdfsf</td
td > sdf</td
td > sdfsad</td
td > 25.00</td

/tr

tr class="color1"></tr
td ><a href="http://www.xxxxxx.com/TELS/AddUser.php?
OP=Delete&Netid=efdwfe"><img src="garbage.jpg" border="0" width="24"
height="24" alt="Symbols-Delete-icon.JPG (892 bytes)"></a></td
td >efdwfe</td
td >efdwfe</td
td > Mike</td
td *> Peloso</td
td > RU</td
td > Lu</td
td > 25.00</td

/tr

tr class="color2"></tr
td ><a href="http://www.xxxxxx.com/TELS/AddUser.php?
OP=Delete&Netid=mpeloso"><img src="garbage.jpg" border="0" width="24"
height="24" alt="Symbols-Delete-icon.JPG (892 bytes)"></a></td
td >mpeloso</td
td >mpeloso</td
td > Mike</td
td *> Peloso</td
td > RU</td
td > Lu</td
td > 25.00</td

/tr

The CSS:
.color1{
* * background: #CCFFCC;
}
.color2{
* * background:#BFD8BC;
}- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -
Holy crap that was stupid.
Thanks


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.