# Power Table Colours

**URL:** <https://forum.inductiveautomation.com/t/power-table-colours/31806>\
**Category:** Ignition\
**Created:** [January 31, 2020, 12:05am UTC](https://forum.inductiveautomation.com/t/power-table-colours/31806 "2020-01-31T00:05:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaushik.shah](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@kaushik.shah](https://forum.inductiveautomation.com/u/kaushik.shah)\
**Post date:** [January 31, 2020, 12:05am UTC](https://forum.inductiveautomation.com/t/power-table-colours/31806/1 "2020-01-31T00:05:59Z")

</div>

I’m trying to configure cell color in ConfigureCell function and it is giving me some little unusual result.

The script looks like :

```auto
	if selected:
		return {'background': self.selectionBackground}
	elif rowView % 2 == 0 and '*' in textValue:
		return {'background': 'white', 'foreground': 'red', 'text':textValue.strip('*')}
	elif rowView % 2 == 0:
		return {'background': 'white'}
	elif rowView % 2 != 0 and '*' in textValue:
		return {'background': '#DDDDDD', 'foreground': 'red', 'text':textValue.strip('*')}
	else :
		return {'background': '#DDDDDD'}
		

```

but it gives white background wherever there is blank cell :

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/c/c434c0b2f33c2620f020d3300679ca8981759a59.png)

Thanks

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 31, 2020, 12:44am UTC](https://forum.inductiveautomation.com/t/power-table-colours/31806/2 "2020-01-31T00:44:29Z")

</div>

For clarity, and to avoid duplication, I’d suggest splitting up your conditions:

```auto
	config = {}
	if selected:
		config['background'] = self.selectionBackground
	elif rowView % 2 == 0 
		config['background'] = 'white'
	else:
		config['background'] = '#DDDDDD'

	if '*' in textValue:
		config['foreground'] = 'red'
		config['text'] = textValue.strip('*')
	
	return config

```

---

<div class="post-metadata">

**Author:** ![kaushik.shah](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@kaushik.shah](https://forum.inductiveautomation.com/u/kaushik.shah)\
**Post date:** [January 31, 2020, 2:09pm UTC](https://forum.inductiveautomation.com/t/power-table-colours/31806/3 "2020-01-31T14:09:01Z")

</div>

I did. But still the same error !
