• Resolved F1st3R

    (@f1st3r)


    Hey, is it possible that I color a result from a specific cell while using formulas?
    I tried doing so:
    <font color=”red”>=D2</font>
    The problem is that in the cell I see “=D2” in red and not the content from cell D2 in red.
    Hope you understand what I mean and thanks in advance!

    https://www.ads-software.com/plugins/tablepress/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    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?

    Plugin Author Tobias B?thge

    (@tobiasbg)

    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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adding a attribute/color to a cell’ is closed to new replies.