/    Sign up×
Community /Pin to ProfileBookmark

change a css class depending on the value in the cell

Hi javascript crowd

Im learning php at the moment and I have managed to create a score board for my school so kids can input their scores and they can have inter school competitions on line, to see who is the best at certain events.

so I am displaying a mysql table and the data is displayed decended depending on the score. I want to be able to assign css class styles to a certain rows that gain certain scores. so above 800 points would display a gold background .
above 500 and not more than 799 would display another colour greay to indicate a silver award.

just wondering if there is anything on this site like this that I can adapt or if anyone could help me with this script.

if so once I have got the script working I can submit it as a tutorial for others to use. especially schools

cheers

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Declan1991Jan 29.2009 — Do you have a sample of the HTML? What does the table look like? (The code that is)
×

Success!

Help @mighty spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...