38
Views
5
Comments
Solved
Condition formatting of table row font color or background color
Question

Hi i have the following table 

Currently i am using the following method to change the project name to light red when the enddate is less than current date

The if check for the following condition;

GetProjects.List.Current.project.active and (CurrDate() <= GetProjects.List.Current.project.enddate)

If true then i will apply the font colour accordingly

If i want the whole row font colour or background to change colour when not active. Can i apply a style below to make conditional formatting of the row font colour or background colour

Appreciate someone can help me with the css syntax

I tried using this but did not work

If(GetProjects.List.Current.project.active and (CurrDate() <= GetProjects.List.Current.project.enddate),"table-row","background-red-light table-row")

Thank you in advance

2024-01-20 14-53-12
Ahmed Essawy
Solution

You can apply the conditions for all the cells to achieve that.

and here are the steps also I have attached the application file for your reference. 

1- define your class with the name background-redExtention and make it !IMPORTANT


2- add your condition for all your cells

If ( DataAction1.Out1.Current.Project = "x" , "background-redExtention" , "")


Happy codeing and Please mark it as a solution if it fulfills your request. 



rowstyle.oap
2021-06-13 07-48-30
Jerah

Thank you for the detail explanation 

2021-06-13 07-48-30
Jerah

@Ahmed Awwad  what about if i just wish to change the font colour ?


2024-01-20 14-53-12
Ahmed Essawy

As you can see here I have changed it to yellow, just extend your custom class background-redExtention  with css property for the font color as per below example : 


.background-redExtention {

    background-color: var(--color-red) !IMPORTANT;

    color: yellow;

}


2021-06-13 07-48-30
Jerah

Got it many thanks for your help , awesome :)

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.