Skip to main content
Participant
June 4, 2010
Question

Styling Negative Numbers

  • June 4, 2010
  • 2 replies
  • 657 views

I have a Coldfusion query that is populating an HTML table.  I would like to style the negative numbers with a Font color of Red and any non negative numbers with a Font color of Black.  Any ideas on how to accomplish this.

    This topic has been closed for replies.

    2 replies

    BreakawayPaul
    Inspiring
    June 6, 2010

    I'd do what Debbie suggested  Something like:

    <span class="#iif(num lt 0,DE("red"),DE("black"))#"> </span>

    Then in your stylesheet:

    .red { color: red; }

    .black { color: black; }

    Participant
    June 4, 2010

    You could use an if statement that checks if the value is less than 0,

    set the font to red, if 0 or greater, set the font to black.