Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    altering bgcolor of cell based on content

    I would like to change the bgcolor of a table data cell based on it's content.
    Nothing fancy, just a color of red if the <td> cell contains any values.
    I haven't done much with ASP but did quite a bit of work with Coldfusion some time ago.

    Can you give me an idea of where to begin?

    Thank You
    Kevin

  • #2
    New Coder
    Join Date
    Jun 2002
    Location
    Vlaardingen, The Netherlands
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb Sure... that shouldn't be too difficult!

    This is just a simple example. There are 100's of different ways to make it work. This is just a simple way. Think it speakse for itself? If not, contact met by email, or visit my website: http://www.paardekam.nl. Good luck!

    IF someVar="someValue" THEN
    Response.Write "<TD BGCOLOR=""#FFFFFF"">" & vbCrLf
    ELSE
    Response.Write "<TD BGCOLOR=""#000000"">" & vbCrLf
    END IF

  • #3
    New Coder
    Join Date
    Jun 2002
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    altering bgcolor of td cell based on cell content

    I thought it might look like what you've shown me but was uncertain as I haven't worked in Vb or done any work in ASP.

    I am actually helping out another party here so if they need something more complicated I would probably pass them along.

    Just out of curiosity what does the [ & vbCrlf ] refer to in the statemtent?

    I appreciate the time and insight

    Thank You
    Kevin
    Last edited by Kevin; 06-23-2002 at 03:11 AM.

  • #4
    New Coder
    Join Date
    Jun 2002
    Location
    Vlaardingen, The Netherlands
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb VbCrLf means...

    No problem. I'm glad to be of any help. The vbCrLf command stands for

    Visual Basic Carriage Return Line Feed

    That probably doesn't say much as well... When you're familiar with HTML, it can be considered as a <BR> tag, but then in the source code. It a line break. Just use it in your code and see what it does, by viewing your source-code. Good luck.

  • #5
    New Coder
    Join Date
    Jun 2002
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    thanx

    I see what your saying on the vb code.
    I have some basics in C at the moment.

    Will be working a little more in that area in the
    near future.

    all insights always appreciated

    Thank You
    Kevin


  •  

    Posting Permissions

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