Table - Power Table

Mornin’ Sirs,

i would like to ask if it is possible to color a single table cell based on a boolean tag status.
We need to check user inputs and return a yellow background on this cell if its value is incorrect.

Thanks in advance,
N.

Yes, just right-click on the power table, select Scripting… and put your code in the configureCell Extension Function.

Just remember that this function runs for every cell in the table, so your code will have to have some way of identifying the cell of interest, maybe by column name and row number for example.

Sure, i got how to identify the cell of interest, but i wanted to know if there are some ways to color that.

Eg: cell.backgroundColor(…) or whatever?

Thanks again,
N.

In configureCell you just return a dictionary containing the desired attribute(s) e.g.

if incorrect:
    return {'background': 'yellow'}
else:
    return {'background': 'white'}