How to change Text Color in table, but not Cell Color

I want to change text color in a cell in a table based on a certain condition. But when I go to color option, it colors the whole cell and not just the text. 

 

Can anyone tell me how to do this?

Comments

  • Hi,

     

    I could give you some code which I have prepared to change color based on specific conditions, please try this based on your conditions using beast mode:

    (

    case

    WHEN `c0` = 'SK-II' and `c4_handle`>='49' THEN CONCAT('<div style="background-color:#fccf84; width: 100%; height:100%; margin:-20px; padding:20px"><a href="#">', `c4_handle`, '</a></div>')

      WHEN `c0` = 'SK-II' and `c4_handle`<'49' THEN CONCAT('<div style="background-color:#fccf60; width: 100%; height:100%; margin:-20px; padding:20px"><a href="#">', `c4_handle`, '</a></div>')

      WHEN `c0` = 'Super Premium' and `c4_handle`>='49' THEN CONCAT('<div style="background-color:#fccf84; width: 100%; height:100%; margin:-20px; padding:20px"><a href="#">', `c4_handle`, '</a></div>')

        WHEN `c0` = 'Domestic' and `c4_handle`>='49' THEN CONCAT('<div style="background-color:#fccf84; width: 100%; height:100%; margin:-20px; padding:20px"><a href="#">', `c4_handle`, '</a></div>')

         WHEN `c0` = 'TR' and `c4_handle`>='49' THEN CONCAT('<div style="background-color:#fccf84; width: 100%; height:100%; margin:-20px; padding:20px"><a href="#">', `c4_handle`, '</a></div>')

        WHEN `c0` = 'TR' and `c4_handle`<'49' THEN CONCAT('<div style="background-color:#fccf15; width: 100%; height:100%; margin:-20px; padding:20px"><a href="#">', `c4_handle`, '</a></div>')

      else `c4_handle`

    end

    )

     

    **Say "Thanks" by clicking the "heart" in the post that helped you.
    **Please mark the post that solves your problem by clicking on "Accept as Solution"

     

    Thanks,

    Neeti

  • Hi @Neeti,

     

    I tried using your piece of code. In my case, I am using a pivot tabl and not a table. Your code seems to color the background in a table, but we are interested in coloring the text only, not the background.

    Do you know what parameter it is?

     

    Moreover, did you try it for a pivot table or a regular table?

    Thanks!

     

     

  • HI,

     

    You can try color rules also, which will either change cell color or row color, based on your selection in color rule window. I have tried this on both pivot and normal table. Also, SUmo table will have more effective color rule implementation. Did you try sumo tables?

     

    Thanks,

    Neeti

  • Hi! I am using this to color a cell for a Mega Table:

     

    CONCAT('<div style="background-color:#69ff96; width: 100%; height:100%; margin:-20px; padding:20px"><a href="#">',CONCAT(`Month Data.ABSENTEEISM`, '%',' ', '(', CASE WHEN `Variance ABSENTEEISM` > 0 THEN '+' ELSE '' END , SUBSTRING(`Variance ABSENTEEISM`, 1, 5),'%', ')'), '</a></div>')

     

    The problem is that, no matter the number I change in the div, I always see a light blue value. 

    Basically I need to green and red colours :(, so I can paint the value based on a condition. 

     

  • jaeW_at_Onyx
    jaeW_at_Onyx Budapest / Portland, OR 🟤

    AFAIK, Mega tables do not support HTML formatting.  HTML tables do, but they don't have all the functionality of Mega Tables (on the fly sorting or scrolling).

This discussion has been closed.