Re: [css-d] alternating coloured rows in dynamic website

2006-12-13 Thread Ed Seehouse
On 12/13/06, Chris Broadfoot <[EMAIL PROTECTED]> wrote:

> > Your sytnax is wrong for the shortcut rule.  It should be {background:
> > #eee none;}
>
> How come?

Well I might be wrong - my memory of validating CSS is that the
validator complains about the background shortcut rule if you don't
specify the background image, or "none" if you don't have one.

> > You should style the tds in the styled row, not the row itself.
> > Descendant selectors allow you to do this easily.

> Why this, as well?

Mostly because putting a border around a tr element never works for
me.  I think it is only meant as a container for cells (th or td
elements).  "td" or "th" are block elements so they do take borders.

But I could be wrong about that too, of course.
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] alternating coloured rows in dynamic website

2006-12-13 Thread Chris Broadfoot
Ed,

> > I am being completely stupid here. Have tried all the suggestions and
> get no
> > alternating colors.
> > tr .even{background:#eee}
> > tr.odd{background:#F9FBF9}
> 
> Your sytnax is wrong for the shortcut rule.  It should be {background:
> #eee none;}

How come?

> You should style the tds in the styled row, not the row itself.
> Descendant selectors allow you to do this easily.

Why this, as well?

Regards
Chris

__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] alternating coloured rows in dynamic website - CRACKED IT

2006-12-13 Thread Ian Young
 alternating colors.
> > tr .even{background:#eee}
> > tr.odd{background:#F9FBF9}

Ed Seehouse wrote
>
> Your sytnax is wrong for the shortcut rule.  It should be {background:
> #eee none;}
>

Not sure I agree with you here.

Solution as follows:

Css
.attributes-even{
background-color:#f9fbf9;
}
.attributes-odd{
background-color:#eee;
}



EOF) {
$rows++;
?>

 all the real stuff
MoveNext();
  }

?>

Thanks to all for your suggestions.

Ian
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.18/584 - Release Date: 12/12/2006
23:17

__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] alternating coloured rows in dynamic website

2006-12-13 Thread Ed Seehouse
On 12/13/06, Ian Young <[EMAIL PROTECTED]> wrote:
> I am being completely stupid here. Have tried all the suggestions and get no
> alternating colors.
> tr .even{background:#eee}
> tr.odd{background:#F9FBF9}

Your sytnax is wrong for the shortcut rule.  It should be {background:
#eee none;}

You should style the tds in the styled row, not the row itself.
Descendant selectors allow you to do this easily.

e.g.

tr.even td {background: #eee none;}

You might need to apply a {border-collapse: collapse;} rule to the
table for this to look right.

Also you don't need to specify two classes, one will do.  Just make
the default style of the table the one color and the td's in the
classed tr rows the other one.

-- 
Ed Seedhouse
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] alternating coloured rows in dynamic website

2006-12-13 Thread Rob Wilmshurst
Hi Ian,

> tr .even{background:#eee}
> tr.odd{background:#F9FBF9}

It's not because of the space before '.even' is it?
Will that not affect children of the , rather than the  itself?

Of course, it could just be that Thunderbird is messing with me this 
morning :)

-Rob

--
Rob Wilmshurst
[EMAIL PROTECTED]


__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] alternating coloured rows in dynamic website

2006-12-13 Thread Ian Young
 Subject: Re: [css-d] alternating coloured rows in dynamic website
>
>
> Hi Ian,
>
> > tr .even{background:#eee}
> > tr.odd{background:#F9FBF9}
>
> It's not because of the space before '.even' is it?


Sorry that was a typo - no space between the tr and .even

Ian
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.18/584 - Release Date: 12/12/2006
23:17

__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] alternating coloured rows in dynamic website

2006-12-13 Thread david
Ian Young wrote:
> I am being completely stupid here. Have tried all the suggestions and get no
> alternating colors.
> tr .even{background:#eee}

Are you really using that line above (with the extra space before the 
period) or is that a typo in your email?

> tr.odd{background:#F9FBF9}
> 
> echo '';
> echo '';
> 
> The above just gives the "odd" color.

-- 
David
[EMAIL PROTECTED]
authenticity, honesty, community
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] alternating coloured rows in dynamic website

2006-12-13 Thread Ian Young
I am being completely stupid here. Have tried all the suggestions and get no
alternating colors.
tr .even{background:#eee}
tr.odd{background:#F9FBF9}

echo '';
echo '';

The above just gives the "odd" color.

HELP!

Ian


**IMPORTANT*
***

This e-mail contains information which is confidential and may also be
privileged. It is for the exclusive use of the intended recipient(s). If you
are not the intended recipient(s) please note that any form of,
distribution, copying or use of this e-mail or the information in it is
strictly prohibited and may be unlawful. If you have received this in error
please inform us at the above address then delete the e-mail and destroy any
copies of it. Thank you.
  -Original Message-
  From: Andy Pemberton [mailto:[EMAIL PROTECTED]
  Sent: 13 December 2006 00:56
  To: Matthew Barnicle
  Cc: Ian Young; [EMAIL PROTECTED] Css-Discuss. Org
  Subject: Re: [css-d] alternating coloured rows in dynamic website


  Generally, I like to add a style rule for regular TRs and then a class for
either TR.odd or TR.even (whichever you'd like).

  tr{
 background-color: #eee;
  }
  tr.odd{
 background-color: #ccc;
  }

  This way, you only need to print out the 'class="odd"' on the odd rows,
which makes your pages smaller and perhaps less complicated.

  Andy

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.18/584 - Release Date: 12/12/2006
23:17
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] alternating coloured rows in dynamic website

2006-12-12 Thread Andy Pemberton
Generally, I like to add a style rule for regular TRs and then a class for
either TR.odd or TR.even (whichever you'd like).

tr{
   background-color: #eee;
}
tr.odd{
   background-color: #ccc;
}

This way, you only need to print out the 'class="odd"' on the odd rows,
which makes your pages smaller and perhaps less complicated.

Andy
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] alternating coloured rows in dynamic website

2006-12-12 Thread Matthew Barnicle
> Have site with alternating colours in dynamic website using php. Want to
> change the code to css.
>
> code as follows:
> $bg = ($bg=='#ee' ? '#F9FBF9' : '#ee'); // Switch the background
> color.
> 
>
> I know it is a table, but it for tabulating results. It is one of pages in
> Zen Cart which I am designing to my own design.
>
> So how do I change the above to something more style friendly?
>
> Cheers
>
> Ian

How about setting a different class for the odd and even rows?


or


Then the CSS:

tr.odd_row {
background-color: #ee;
}

tr.even_row {
background-color: #f9fbf9
}

- Matt

__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] alternating coloured rows in dynamic website

2006-12-12 Thread Steve Clason
Ian Young wrote:
> Have site with alternating colours in dynamic website using php. Want to
> change the code to css.
> 
> code as follows:
> $bg = ($bg=='#ee' ? '#F9FBF9' : '#ee'); // Switch the background
> color.
> 
> 
> I know it is a table, but it for tabulating results. It is one of pages in
> Zen Cart which I am designing to my own design.
> 
> So how do I change the above to something more style friendly?

I'd do it something like this:

$rowClass = ($rowClass=='odd' ? 'even' : 'odd');


Untested, YMMV, etc.

Then you can alter the background colors in the stylesheet and make 
other changes as well if you decide you want them later.

So,

tr.odd {background-color: #eee}
tr.even {background-color: #F9FBF9]

-- 
Steve Clason
Boulder, Colorado, USA
(303) 818-8590
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] alternating coloured rows in dynamic website

2006-12-12 Thread Matt Barnicle
> Have site with alternating colours in dynamic website using php. Want to 
> change the
code to css.
>
> code as follows:
> $bg = ($bg=='#ee' ? '#F9FBF9' : '#ee'); // Switch the background 
> color.
> 
>
> I know it is a table, but it for tabulating results. It is one of pages in 
> Zen Cart
which I am designing to my own design.
>
> So how do I change the above to something more style friendly?
>
> Cheers
>
> Ian

How about setting a different class for the odd and even rows?


or


Then the CSS:

tr.odd_row {
background-color: #ee;
}

tr.even_row {
background-color: #f9fbf9
}

- Matt



__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


[css-d] alternating coloured rows in dynamic website

2006-12-12 Thread Ian Young
Have site with alternating colours in dynamic website using php. Want to
change the code to css.

code as follows:
$bg = ($bg=='#ee' ? '#F9FBF9' : '#ee'); // Switch the background
color.


I know it is a table, but it for tabulating results. It is one of pages in
Zen Cart which I am designing to my own design.

So how do I change the above to something more style friendly?

Cheers

Ian

**IMPORTANT*
***

This e-mail contains information which is confidential and may also be
privileged. It is for the exclusive use of the intended recipient(s). If you
are not the intended recipient(s) please note that any form of,
distribution, copying or use of this e-mail or the information in it is
strictly prohibited and may be unlawful. If you have received this in error
please inform us at the above address then delete the e-mail and destroy any
copies of it. Thank you.

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.16/582 - Release Date: 11/12/2006
16:32
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/