Hello everyone,
Id like to see if its possible to change the row color of a table based on a value in the row. As of right now i have done some tests, but cant seem to figure out how to do it correctly or assign an individual row a color.
I want to color the row red in case the column value at a certain index is None, and for the others i want to color them green.
This is the code im using in the configureCell extended function of a power table:
tabla = self.data
for row in range(tabla.getRowCount()):
valor_revisado = tabla.getValueAt(row, 'Revisado_Por')
#print valor_revisado
if None in valor_revisado:
return {'background': 'red'}
else:
return {'background': 'green'}
The problem is this code just colors the whole table.
I was hoping i could get some assistance from you guys.
Thanks.
Daniel