473,651 Members | 2,765 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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 "expression s". 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
Jul 20 '05 #1
47 18875
"Matt Kruse" <ne********@mat tkruse.com> wrote in message
news:ch******** *@news2.newsguy .com...
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 "expression s".
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.

Jul 20 '05 #2
"Matt Kruse" <ne********@mat tkruse.com> wrote:
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
Jul 20 '05 #3
Matt Kruse wrote:
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 "expression s". 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.
Jul 20 '05 #4
Matt Kruse wrote:
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.


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?

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Jul 20 '05 #5
On Tue, 7 Sep 2004, Matt Kruse wrote:
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.
The answers are usually 1) you can't (yet),
Where did you get -that- from?
2) put a class on every other tr,
WFM.
or 3) use javascript to do the styling for you.
Pointless, unnecessary.
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.
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.
Jul 20 '05 #6
On Tue, 7 Sep 2004 14:56:23 -0500, "Matt Kruse"
<ne********@mat tkruse.com> wrote:
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
Jul 20 '05 #7
philiphjones wrote:
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.infosystem s.www.authoring.* hierarchy. People who want to engage in
exclusionary practices are advised to find a more suitable platform.

--
Spartanicus
Jul 20 '05 #8
C A Upsdell wrote:
I use a gecko-based browser, as do 27% of my visitors.
Your stats are not the norm. *shrugs*
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?
What audience uses IE 5.5+ only? Maybe a company intranet that uses
Windows and no other O/S
Happens all the time.
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
Jul 20 '05 #9
Toby Inkster wrote:
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
Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2378
by: Wayne Wengert | last post by:
I have a solution. I want to clone it to try some different options. Is there a way to open Solution A, save it as Solution B and then be able to try some things in Solution B without affecting Solution A? -- ------------------------------------ Wayne Wengert wayne@wengert.org
10
510
by: Simon Jefferies | last post by:
Hello, I'm getting a strange problem where when I load up my solution that has three projects:- a managed C++ .NET, one C++ lib, and a VB library. It locks up and doesn't load completely, I have to do the following to work around it.
0
1636
by: TEK | last post by:
Hello We have a quite huge project. To limit the solution size, rebuild time and so on we have divided the project in two different solution. One solution that holds the buiness entities, or mapping and stuff like that. One solution that holds the application, windows controls and stuff like that.
6
18561
by: I_AM_DON_AND_YOU? | last post by:
I have a small VB.Net Solution. The solution has filename LABELMAKER.SLN and the the project has filename LABELMAKER.VBPROJ. There is another file LABELMAKER.VBPROJ.USER. All these are in a directory called LABELMAKER. Everything is working fine. I just wanted to rename the directory and filenames. So I changed the directory name as "EASYLABEL" and also changed the filenames as EASYLABEL.SLN, EASYLABEL.VBPROJ and EASYLABEL.USER. So...
5
2212
by: kai | last post by:
Hi, I use XP Pro and VS2005. I find when I create a new Website, I only see the Project node not Solution. After I add sedcond project under the solution tree, then I see the solution node. How do I setup VS2005 to see the solution node after I create the first project without adding the second project in the same solution? Thanks
2
1766
by: mkd1919 | last post by:
I'm developing a web service that will eventually be sent to other like organizations to communicate for a particular application. After a few weeks, I decided it would be better to split of the web service and custome code from the required code. In doing so, I created a class project. This left me with a new solution of a web site and a class. I had previously created the class seperately and added it to sourcesafe. I then added...
3
2154
by: Manikandan | last post by:
Hi, I'm copying projects from a solution in the vss. In my local system i created solution ,added that project(make modification related to solution) When i added this solution to vss, projects are referred to the original solution not from my new solution I will explain more clearly i have project folder in vss(v4.5) v4.5(folder) project1(project)
0
2338
by: techie | last post by:
List of Solution manuals: Engineering Circuit Analysis 6Ed - Hayt Solutions Manual Norbury - Solutions manual for mechanics and thermodynamics Physics For Scientists And Engineers - Solution Manual RC Hibbeler statistics 11th edition
9
2373
by: GaryDean | last post by:
I know this is a vs issue but nobody seems to answer posts over there... In VS 2008 I can't seem to get a multiple project solution. If I create a blank solution and add a project to it, it becomes just a project with not solution node at the top so I can't "add a project" to the node. If I add a project from the file menu it becomes that new project. I'm using Vista. Anyone have a clue? Thanks, Gary
16
3988
by: =?Utf-8?B?RHdlZWJlcmVsbGE=?= | last post by:
I created an Access 2007 application for my customer. The application is shared by three employees on a server. It maintains a contact list including financial data and social security numbers. Only the office manager generates reports in Access from this client data. Now they want to share this Access application with employees at a remote office. They expect to have a maximum of 30 employees editing the client list in both the...
0
8803
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8700
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8465
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8581
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7298
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5612
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4285
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1910
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.