• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Styling Negative Numbers

New Here ,
Jun 04, 2010 Jun 04, 2010

Copy link to clipboard

Copied

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.

Views

569

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 04, 2010 Jun 04, 2010

Copy link to clipboard

Copied

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.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jun 06, 2010 Jun 06, 2010

Copy link to clipboard

Copied

LATEST

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; }

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation