Results 1 to 3 of 3

Thread: help me please i am in trouble

  1. #1
    Join Date
    Jun 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default help me please i am in trouble

    hi,
    i have a jsp page, in this page i am displaying data retrieved from mysql database. Now the problem is i must color table cell based on cell value. how to implement this.please give me an sample or working code foe this problem.( any code is accepted) preferably html or javascript.
    i.e
    if cell value is "late" then display that cell in red color(cell bgcolor=red)
    else
    display the cell in green color
    please help me.

    Thanks ad Regards
    Akash

  2. #2
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    Something like this (in the head section)?

    Code:
    //query & pass values to JS
    if(value == Late){
            document.write("<style type='text/css'>td#yourcellid{background-color: #FF0000;}</style>");
    }else{
            document.write("<style type='text/css'>td#yourcellid{background-color: #00FF00;}</style>");
    }
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I suggest just using JSP to set a style for the td element.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

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
  •