SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Sep 2004
    Location
    Australia
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    color highlighting

    Hi everyone,

    Ive created a web page that queries a db and i have that all working fine. What i dont have though and would like to be able to do is get the page to highlight rows according to one colums value, ie


    Colum1 Colum2
    Row 1 50 Test <-- would like to the be highlihted lite blue for instance
    Row 2 90 Test2 <-- would like this to be highlighted red for instance

    Ive attached a file to show what i mean, any help on this would be much appreciated
    Attached Images Attached Images

  2. #2
    SitePoint Addict sinapra's Avatar
    Join Date
    Sep 2004
    Location
    secunderabad
    Posts
    272
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    are you using dotnet technology or plain ASP? I am not sure how it could be done in plain ASP but in dotnet, its possible? can you let me know, I will in the meanwhile try to see if there is any possibility in ASP.
    Regards

    Its Great to work and Be Merry!!!!!!!!

  3. #3
    SitePoint Member
    Join Date
    Sep 2004
    Location
    Australia
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sinapra
    are you using dotnet technology or plain ASP? I am not sure how it could be done in plain ASP but in dotnet, its possible? can you let me know, I will in the meanwhile try to see if there is any possibility in ASP.

    after much frustration over the last couple of days posting on several forums etc i finally played around and read enough on the web to develop the code myself.

    to answer your question i am using plain asp, and it is possible as i have done it. below is the code:

    this was added after the db query but before the tables are drawn and data inserted.

    Code:
    <%
    x = CINT(FP_FieldVal(fp_rs,"Severity"))
    if x <= 10 then
    bgcolor = "#E42217"
    elseif x => 11 and x <= 30 then
    bgcolor = "orange"
    elseif x => 31 and x <= 50 then
    bgcolor = "yellow"
    elseif x => 51 and x <= 70 then
    bgcolor = "#82CAFF"
    elseif x => 71 and x <= 90 then
    bgcolor = "#41A317"
    end if
    %>

    this was added to where the tables were drawn after the db has been queried.
    Code:
     <td BGCOLOR=<%=bgcolor%>>
    Thanks for your reply though, i must say this and dbforums are the only two of the 5 forums i posted in i had a responce in.

    Thanks heaps

    final shot of the working site is attached
    Attached Images Attached Images

  4. #4
    SitePoint Addict sinapra's Avatar
    Join Date
    Sep 2004
    Location
    secunderabad
    Posts
    272
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wow that may help me out, but its still very orthodox way of doing it, may be we will try a better way out. cheers!!!
    Regards

    Its Great to work and Be Merry!!!!!!!!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •