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 :
First we make a couple of Conditional rules like this :
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 :
Let me know if that makes sense, and if that works for you?
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.
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!
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 :
First we make a couple of Conditional rules like this :
Then we add this custom CSS to the table Customize/Custom CSS:
And now the text of the cells that contain my condition in the content, have changed text color :
Let me know if that makes sense, and if that works for you?
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
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia 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
Thank you so much for this! Works great!
Cheers!!!