0

Table cels Background color

Good morning,

I would like to create a rule so that the background is green when the indication is 'NO' and green when the indication is 'YES'. I saw that NINOX provides this for sub-tables, but not for tables.

Does anyone have a solution?

Thanks in advance and have a nice day everyone

5 replies

null
    • Kruna
    • 1 yr ago
    • Reported - view

    Hi Didier, if I understand right it should be the following code

    if 'Gérer en stock' = 1 then
        styled(text('Gérer en stock'), "Red", "", "")
    else
        styled(text('Gérer en stock'), "Green", "", "")
    end

     

    alternatively, if you like to chose color by RGB you can use the following code:

     

    let green := color("rgb(156,255,181)");
    let text_clr := color("rgb(255,255,255)");
    let red := color("rgb(255,145,135)");
    if 'Gérer en stock' = 1 then
        styled(text('Gérer en stock'), green, text_clr, "")
    else
        styled(text('Gérer en stock'), red, text_clr, "")
    end

     

    I hope that this will work for you.

     

    Cheers Kruna

      • Didier_Schoonjans
      • 1 yr ago
      • Reported - view

      Kruna 

      I took the liberty of modifying your code a bit.

      There are ways to have fun and make the boards more fun

       

      if 'Gérer en stock' = 0 then
          styled(text('Gérer en stock'), "", "red", "")
      else
          styled(text('Gérer en stock'), "", "", "green")
      end

       

      On the other hand I don't like that the title of the column is modified. And I can't find how to make "Gérer en stock" reappear simply

       

      • Kruna
      • 1 yr ago
      • Reported - view

      Didier Schoonjans you can write the title in the field where you see the code. Pls take a look at the second image I enclosed. The black arrow shows where (fx) you can enter the code. One the left side there is a field, there you can enter the title of the column.

      • Didier_Schoonjans
      • 1 yr ago
      • Reported - view

      Kruna 

      yes really sorry. Indeed it was enough to reintroduce the title.
      thanks again

    • Didier_Schoonjans
    • 1 yr ago
    • Reported - view

    Thank’s Kruna

    Finally it's very simple, I expected a more complicated solution.
    I just inverted the colors (via "if" which I placed at "0" earlier than at "1" .

    Thank you so much.

    On the other hand, the title of the column has disappeared and is replaced by the formula.

Content aside

  • Status Answered
  • 1 yr agoLast active
  • 5Replies
  • 142Views
  • 2 Following