I want to alter my table background colour depending on the column. I have 7 columns in the table and I want the first four to be one colour and the last 3 to be a second colour.
Hey Aval,
If you go into the scripting for the power table component there will be a section labled "configureCell". Whatever script is in there will be iterated over for each cell in the table. So what you can do is just use the index of the row saying "if index between 0 and 2 return this color, else return this color". Make sure you are using a power table, the regular table component doesn't have a configure cell script.
1 Like
Here is an example script and the appearance.
def configureCell(self, value, textValue, selected, rowIndex, colIndex, colName, rowView, colView):
if rowIndex <= 2:
return {'background': 'red'}
else:
return {'background': 'blue'}
1 Like
It worked. Thank you
No problem