Hi,
thanks for your post, and sorry for the trouble.
No, sorry, this is not possible like that. It is possible to add extra content to cells with formulas, but not code like that.
Instead, I suggest to use the CSS approach from https://tablepress.org/faq/highlight-cells-or-content/
Regards,
Tobias
Thread Starter
F1st3R
(@f1st3r)
Thanks for the suggestion, but I would like to do an if-condition (if a value is negative color it red, else green), so this would not work with the CSS approach. Do you have any other suggestions how I could get that to work?
Hi,
Unfortunately, I don’t have a working solution to this, but it should not be too hard to do this with some custom coding. You’ll want to hook into the tablepress_cell_css_class filter hook (see class-render.php), and then check the cell content. Depending on whether it is positive or negative, you can then return an additional CSS class to the cell, which you can use to style the background color of the cell.
Regards,
Tobias