Web Analytics Made Easy -
StatCounter altering bgcolor of cell based on content - CodingForum

Announcement

Collapse
No announcement yet.

altering bgcolor of cell based on content

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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
    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
    Check out http://webcam.paardekam.nl/ to see how I'm doing in The Netherlands.

    Comment


    • #3
      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; Jun 22, 2002, 11:11 PM.

      Comment


      • #4
        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.
        Check out http://webcam.paardekam.nl/ to see how I'm doing in The Netherlands.

        Comment


        • #5
          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

          Comment

          Working...
          X