Hey there, Awesome Customers!

Just a heads up: We'll be taking a breather to celebrate International Workers' Day (May 1st and 2nd - Wednesday and Thursday) and Orthodox Easter from Good Friday (May 3rd) through Easter Monday (May 6th). So, from May 1st to May 6th, our team will be off enjoying some well-deserved downtime.

During this time, our customer support will be running on a smaller crew, but don't worry! We'll still be around to help with any urgent matters, though it might take us a bit longer than usual to get back to you.

We'll be back in action at full throttle on May 7th (Tuesday), ready to tackle your questions and requests with gusto!

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find loads of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel). These gems might just have the answers you're looking for while we're kicking back.

Thanks a bunch for your understanding and support!

Catch you on the flip side!

Warm regards,

TMS

Okay
  Public Ticket #3611961
Font Colors Based on Positive or Negative Integers
Open

Comments

  •  1
    Paka Monette started the conversation

    Hi! I'm just wondering if there's a way to display a font color based on whether the number is positive or negative?

    Many thanks!

  •  1,692
    Miloš replied

    Hello,

    Firstly, I would like to sincerely apologize for the delayed response as we have been experiencing an unusually high number of tickets. I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.

    -

    Here is how you can achieve to set a Conditional rule on the column that will set different color text if the cell has certain content.

     I will give you an example from my Test Table with some Countries in a column.

    If I have a column like this :

    9030176545.png

    First we make a couple of Conditional rules like this :

    9851449705.png

    Then we add this custom CSS to the table Customize/Custom CSS:

    td.Green {  
      color: green !important;
    }
    td.Red {  
      color: red !important;
    }
    

    And now the text of the cells that contain my condition in the content,  have changed text color :

    4397674577.png

    Let me know if that makes sense, and if that works for you?smile.png 


    In your use case, just change the Condion to be :

    if any cell is less than 0 , then set a custom css class name;

    if larger than  0, then set a different class to the cell;

    and then call the class in Custom CSS in the same way as in the example above, and edit the colours as needed.


    Let me know how it goes and if you require any further assistance with this.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •  1
    Paka Monette replied

    Thank you so much for this! Works great! 


    Cheers!!!

  •   Miloš replied privately