HighDots Forums  

Cell Color depending on value

alt.html.tags alt.html.tags


Discuss Cell Color depending on value in the alt.html.tags forum.



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

Default Cell Color depending on value - 10-01-2004 , 10:14 PM






I'm new to stylesheets and have a question:
Via a stylesheet, is it possible to set the color of a cell based on the
value it contains. I have a table that has cell values of Pass or Fail. I
would like pass to show up as green and fail to be red without writing code
that checks the value of every cell and changes the color depending on the
value.

Any ideas?

Scott



Reply With Quote
  #2  
Old   
David Dorward
 
Posts: n/a

Default Re: Cell Color depending on value - 10-02-2004 , 01:53 AM






Scott Johnson wrote:

Quote:
I'm new to stylesheets and have a question:
comp.infosystems.www.authoring.stylesheets might be a better place to ask.

Quote:
Via a stylesheet, is it possible to set the color of a cell based on the
value it contains.
With CSS? No.

With Microsoft's style sheet language? Perhaps (see expression()) but that
language isn't really suitable for the WWW.

Looping through the table and adding a class attribute to each cell based on
the contents of the node is a fairly trivial exercise in Perl. Take a look
at HTML:TreeBuilder and the rest of LWP if you decide to go down that
route.


--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


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.