This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > July 2004 > odd/even table rows





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author odd/even table rows
bill drescher

2004-07-18, 7:15 pm

I have a long table and I want to have the alternating rows slightly
different colors for clarity.

Is there any way to avoid using a class designation in each tr ?

(yes, it is for tabular data !)
--
Bill Drescher
william {at} TechServSys {dot} com
Ben Shimmin

2004-07-18, 7:15 pm

bill drescher <nobody@Spamcop.net>:
> I have a long table and I want to have the alternating rows slightly
> different colors for clarity.
>
> Is there any way to avoid using a class designation in each tr ?
>
> (yes, it is for tabular data !)


<URL:http://www.alistapart.com/articles/zebratables/>

In short, no.

b.

--
Ben Shimmin (bas@bas.me.uk) <URL:http://bas.me.uk/>
<URL:http://gpg.bas.me.uk/>
brucie

2004-07-18, 7:15 pm

in post: <news:10flrhtsihsnifb@corp.supernews.com>
bill drescher <nobody@Spamcop.net> said:

> I have a long table and I want to have the alternating rows slightly
> different colors for clarity. Is there any way to avoid using a
> class designation in each tr ?


http://moreshit.usenetshit.info/alt...lor-thingy.shit

> (yes, it is for tabular data !)


thats what they all say

--
b r u c i e


bill drescher

2004-07-18, 11:15 pm

brucie wrote:

> in post: <news:10flrhtsihsnifb@corp.supernews.com>
> bill drescher <nobody@Spamcop.net> said:
>
>
>
>
> http://moreshit.usenetshit.info/alt...lor-thingy.shit


still too much work, and classes are more intuitive

>
>
>
>
> thats what they all say
>

columns are:
Date Location results

looks like tabular data to me, maybe even to you.


--
Bill Drescher
william {at} TechServSys {dot} com
Brian

2004-07-19, 4:16 am

bill drescher wrote:

> I have a long table and I want to have the alternating rows
> slightly different colors for clarity.
>
> Is there any way to avoid using a class designation in each tr ?


Not until CSS 3 is adopted. Hold your breath. ;-)

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Stan Brown

2004-07-19, 4:16 am

"bill drescher" <nobody@Spamcop.net> wrote in
comp.infosystems.www.authoring.stylesheets:
>I have a long table and I want to have the alternating rows slightly
>different colors for clarity.
>
>Is there any way to avoid using a class designation in each tr ?


You don't have to class _every_ tr, but you do have to class either
each even row or each odd row. There's no way out there that works
in IE.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Stan Brown

2004-07-19, 12:16 pm

"Stan Brown" <the_stan_brown@fastmail.fm> wrote in
comp.infosystems.www.authoring.stylesheets:
>"bill drescher" <nobody@Spamcop.net> wrote in
>comp.infosystems.www.authoring.stylesheets:
>
>You don't have to class _every_ tr, but you do have to class either
>each even row or each odd row. There's no way out there that works
>in IE.


Sorry -- that last sentence makes no sense. What I meant to say was
that no way out there will work with IE, _other_ than classing each
even row or classing each odd row. For instance, if you class each
even row with <tr class="even">, your CSS would be:

table tr td { /* odd row stuff */ }

table tr.even td { /* even row stuff */ }

(As others have posted, the real solution is CSS3, but hardly any
browsers support it. Since IE doesn't, and IE users dominate the
market, it hardly matters what other browsers -- if any -- support
CSS3.)

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
JayB

2004-07-19, 7:16 pm


"bill drescher" <nobody@Spamcop.net> wrote in message
news:10fm5d2smdaahe9@corp.supernews.com...
> brucie wrote:
>
>
> still too much work, and classes are more intuitive
>
> columns are:
> Date Location results
>
> looks like tabular data to me, maybe even to you.


Brucie's reply looks like sarcasm to me. Maybe not to you.

--
JayB


bill drescher

2004-07-20, 12:17 pm

Stan Brown wrote:
> "Stan Brown" <the_stan_brown@fastmail.fm> wrote in
> comp.infosystems.www.authoring.stylesheets:
>
>
>
> Sorry -- that last sentence makes no sense. What I meant to say was
> that no way out there will work with IE, _other_ than classing each
> even row or classing each odd row. For instance, if you class each
> even row with <tr class="even">, your CSS would be:
>
> table tr td { /* odd row stuff */ }
>
> table tr.even td { /* even row stuff */ }
>
> (As others have posted, the real solution is CSS3, but hardly any
> browsers support it. Since IE doesn't, and IE users dominate the
> market, it hardly matters what other browsers -- if any -- support
> CSS3.)
>


Thanks, that cut the work in half and is educational to boot.
Thank goodness for global find and replace as that makes the rest of the
job easy. (not a css construct, just HTML-Kit)

--
Bill Drescher
william {at} TechServSys {dot} com
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews