How to customize the background color of a power table cell?

The best way is to use the power table’s configureCell extension function. Right click on the component and select Scripting. You will see configureCell extension function with an example. Something like this:

if selected:
	return {'background': self.selectionBackground}
elif rowView % 2 == 0:
	return {'background': 'white'}
else:
	return {'background': '#DDDDDD'}

You can certainly adjust that for an individual cell by doing the following:

if colIndex == 0 and rowIndex == 0:
	return {'background': '#DDDDDD'}
else:
	return {'background': 'white'}

Hope this helps.

2 Likes