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

Original post: Customizing Table Column's Font Color

How would I modify the background color of the power tables’ cell?
The example for '<HTML><FONT COLOR=green>' works but I can’t figure out the attribute for background color.

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