HighDots Forums  

Solution! Alternating table row colors (fun with CSS Expressions)

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


Discuss Solution! Alternating table row colors (fun with CSS Expressions) in the Cascading Style Sheets forum.



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

Default Solution! Alternating table row colors (fun with CSS Expressions) - 09-07-2004 , 02:56 PM






http://www.mattkruse.com/temp/css_expressions.html

One of the standard CSS questions is "how can I shade every other table row
a different color with CSS?"

The answers are usually 1) you can't (yet), 2) put a class on every other
tr, or 3) use javascript to do the styling for you.

Well, I've been playing the CSS expressions quite a bit lately and I've
found a much simpler solution which works in IE5.5+, using "expressions". If
you're creating a web app that uses exclusively IE, or if you want to add
this feature for the majority of site visitors (using IE), then you can use
the technique in the url above. At that url are some other fun things that
CSS expressions can do also.

I realize the CSS expressions are non-standard and not a solution which
everyone will find acceptable. But for those that can accept the limited
browser support (IE only) then they are quite powerful and convenient. On
projects where IE is the only browser being used to access the web app, this
is going to be a great solution for me, I think. And in the future, as CSS
evolves and browsers support more advanced selectors, the CSS file can be
changed simply without needing to change anything in the content.

Thoughts?

--
Matt Kruse
http://www.JavascriptToolbox.com



Reply With Quote
  #2  
Old   
C A Upsdell
 
Posts: n/a

Default Re: Solution! Alternating table row colors (fun with CSS Expressions) - 09-07-2004 , 03:29 PM






"Matt Kruse" <newsgroups (AT) mattkruse (DOT) com> wrote

Quote:
http://www.mattkruse.com/temp/css_expressions.html

One of the standard CSS questions is "how can I shade every other table
row
a different color with CSS?"

The answers are usually 1) you can't (yet), 2) put a class on every other
tr, or 3) use javascript to do the styling for you.

Well, I've been playing the CSS expressions quite a bit lately and I've
found a much simpler solution which works in IE5.5+, using "expressions".
If
you're creating a web app that uses exclusively IE, or if you want to add
this feature for the majority of site visitors (using IE), then you can
use
the technique in the url above. At that url are some other fun things that
CSS expressions can do also.

I realize the CSS expressions are non-standard and not a solution which
everyone will find acceptable. But for those that can accept the limited
browser support (IE only) then they are quite powerful and convenient. On
projects where IE is the only browser being used to access the web app,
this
is going to be a great solution for me, I think. And in the future, as CSS
evolves and browsers support more advanced selectors, the CSS file can be
changed simply without needing to change anything in the content.

Thoughts?
I use a gecko-based browser, as do 27% of my visitors. An IE-only solution
is no solution at all for me.

What audience uses IE 5.5+ only? Maybe a company intranet that uses Windows
and no other O/S, that plans always to use IE and no other O/S, and knows
that its plans will never change. Methinks your solution is a curiousity
only.





Reply With Quote
  #3  
Old   
Spartanicus
 
Posts: n/a

Default Re: Solution! Alternating table row colors (fun with CSS Expressions) - 09-07-2004 , 04:03 PM



"Matt Kruse" <newsgroups (AT) mattkruse (DOT) com> wrote:

Quote:
I realize the CSS expressions are non-standard and not a solution which
everyone will find acceptable.

Thoughts?
Note the "www" in this group's name, hence your "method" is off topic
here. I'd suggest you go and crow about your "invention" in the
microsoft.* hierarchy.

--
Spartanicus


Reply With Quote
  #4  
Old   
Stuart Gilbert
 
Posts: n/a

Default Re: Solution! Alternating table row colors (fun with CSS Expressions) - 09-07-2004 , 05:03 PM



Matt Kruse wrote:
Quote:
http://www.mattkruse.com/temp/css_expressions.html

One of the standard CSS questions is "how can I shade every other table row
a different color with CSS?"

The answers are usually 1) you can't (yet), 2) put a class on every other
tr, or 3) use javascript to do the styling for you.

Well, I've been playing the CSS expressions quite a bit lately and I've
found a much simpler solution which works in IE5.5+, using "expressions". If
you're creating a web app that uses exclusively IE, or if you want to add
this feature for the majority of site visitors (using IE), then you can use
the technique in the url above. At that url are some other fun things that
CSS expressions can do also.

I realize the CSS expressions are non-standard and not a solution which
everyone will find acceptable. But for those that can accept the limited
browser support (IE only) then they are quite powerful and convenient. On
projects where IE is the only browser being used to access the web app, this
is going to be a great solution for me, I think. And in the future, as CSS
evolves and browsers support more advanced selectors, the CSS file can be
changed simply without needing to change anything in the content.

Thoughts?

I have absolutely no use for this, but unlike the previous two people
I'm not going to make any cutting remarks or anything like that.

Congratulations on making something that someone might find useful. Now
try and see if you can think of a way to get it working in every browser

Regards,

Stuart.


Reply With Quote
  #5  
Old   
Alan J. Flavell
 
Posts: n/a

Default Re: Solution! Alternating table row colors (fun with CSS Expressions) - 09-07-2004 , 06:02 PM



On Tue, 7 Sep 2004, Matt Kruse wrote:

Quote:
One of the standard CSS questions is "how can I shade every other
table row a different color with CSS?"
Table -rows- are easy, using standard means. So I'm not so very
interested in a non-WWW-only solution, even if it -does- "work" for
the unthinking masses who run a WWW-violating operating system
component instead of a web browser.

Table -columns- in alternating colours are quite awkward, though.
Well, of course it's easy, but it seems so wasteful setting classes on
every damned table cell, that one feels the need to find a more
appealing solution.

Quote:
The answers are usually 1) you can't (yet),
Where did you get -that- from?

Quote:
2) put a class on every other tr,
WFM.

Quote:
or 3) use javascript to do the styling for you.
Pointless, unnecessary.

Quote:
I realize the CSS expressions are non-standard and not a solution
which everyone will find acceptable.
Fine. CSS is optional too, so that's not a problem in itself.

Quote:
Thoughts?
More of a worry to me is that you're prepared to support a
WWW-violating browser-like operating system component to the
apparent -exclusion- of the WWW.

MSIE isn't as incapable of rendering WWW-conforming pages as its
vendors would like us to believe. It needs a following wind and a bit
of tender care (I'll omit the "loving" part of that stock phrase), but
with suitable attention to detail it can cope.

If you want a windows-narrow web, then fine, you're entitled to your
opinion; but this here is supposed to be a WWW group.

Hope this helps.


Reply With Quote
  #6  
Old   
philiphjones
 
Posts: n/a

Default Re: Solution! Alternating table row colors (fun with CSS Expressions) - 09-07-2004 , 06:23 PM



On Tue, 7 Sep 2004 14:56:23 -0500, "Matt Kruse"
<newsgroups (AT) mattkruse (DOT) com> wrote:
Quote:
I realize the CSS expressions are non-standard and not a solution which
everyone will find acceptable.
It's lovely that people can get all high and mighty about being able
to turn their backs on MS's products. Some of us work for firms that
have adopted IE as THE ONLY BROWSER, and so spend a good bit of time
and energy getting it to do what we need it to do.

As one of those people in that fix, I'm very grateful for these
tricks; the alternating table rows is one I'm sure I'll use. Getting
another job where I don't have to work under such constraints,
appealing as it might sound, isn't really realistic.

I hope this newsgroup doesn't adopt as a criterion for posts that they
only apply to all browsers, or even the widest possible assortment.

Philip Jones


Reply With Quote
  #7  
Old   
Spartanicus
 
Posts: n/a

Default Re: Solution! Alternating table row colors (fun with CSS Expressions) - 09-07-2004 , 07:05 PM



philiphjones wrote:

Quote:
I hope this newsgroup doesn't adopt as a criterion for posts that they
only apply to all browsers, or even the widest possible assortment.
The latter is what is and has always been propagated in the
comp.infosystems.www.authoring.* hierarchy. People who want to engage in
exclusionary practices are advised to find a more suitable platform.

--
Spartanicus


Reply With Quote
  #8  
Old   
Matt Kruse
 
Posts: n/a

Default Re: Solution! Alternating table row colors (fun with CSS Expressions) - 09-07-2004 , 07:50 PM



C A Upsdell wrote:
Quote:
I use a gecko-based browser, as do 27% of my visitors.
Your stats are not the norm. *shrugs*

Quote:
An IE-only solution is no solution at all for me.
Okay, that's cool. So why would you respond, if it doesn't apply to you?

Quote:
What audience uses IE 5.5+ only? Maybe a company intranet that uses
Windows and no other O/S
Happens all the time.

Quote:
that plans always to use IE and no other
O/S, and knows that its plans will never change. Methinks your
solution is a curiousity only.
Nope, it's a solution for a substantial subset of all browsers, which many
people will find useful and a solution to their specific requirements.
Whether you agree with the requirements or not really doesn't matter in this
context.

--
Matt Kruse
http://www.JavascriptToolbox.com




Reply With Quote
  #9  
Old   
Matt Kruse
 
Posts: n/a

Default Re: Solution! Alternating table row colors (fun with CSS Expressions) - 09-07-2004 , 07:51 PM



Spartanicus wrote:
Quote:
Note the "www" in this group's name, hence your "method" is off topic
here.
Not at all. Don't be so obtuse.
No solution works on every browser. Whether or not a specific solution will
work for you depends on requirements.

--
Matt Kruse
http://www.JavascriptToolbox.com




Reply With Quote
  #10  
Old   
Matt Kruse
 
Posts: n/a

Default Re: Solution! Alternating table row colors (fun with CSS Expressions) - 09-07-2004 , 07:56 PM



Toby Inkster wrote:
Quote:
Correct me if I'm wrong (and I may well be), but don't MSIE's
expressions require JScript to be enabled? If so, what's the
advantage of using them over proper scripting?
They do require scripting to be on. I think they are much easier to
implement because with a scripting solution you need to either fire the
action onLoad of the document, or put the script at the bottom of the
document to run after the main document loads. That's more of a hassle than
simply including a css file, IMO.

--
Matt Kruse
http://www.JavascriptToolbox.com




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 - 2008, Jelsoft Enterprises Ltd.