# Configure Individual Cell Color based on Value (Vision Power Table)

**URL:** <https://forum.inductiveautomation.com/t/configure-individual-cell-color-based-on-value-vision-power-table/57776>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [March 29, 2022, 9:07pm UTC](https://forum.inductiveautomation.com/t/configure-individual-cell-color-based-on-value-vision-power-table/57776 "2022-03-29T21:07:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel\_bazan](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@daniel\_bazan](https://forum.inductiveautomation.com/u/daniel_bazan)\
**Post date:** [March 29, 2022, 9:07pm UTC](https://forum.inductiveautomation.com/t/configure-individual-cell-color-based-on-value-vision-power-table/57776/1 "2022-03-29T21:07:42Z")

</div>

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:

```auto
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

---

<div class="post-metadata">

**Author:** ![gdube](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gdube/32/41701_2.png) [@gdube](https://forum.inductiveautomation.com/u/gdube)\
**Post date:** [March 29, 2022, 9:18pm UTC](https://forum.inductiveautomation.com/t/configure-individual-cell-color-based-on-value-vision-power-table/57776/2 "2022-03-29T21:18:14Z")

</div>

Hi Daniel, is that code as-is from your ‘configureCell’ function?

That function is called once per cell in a table, and it seems you’re looping from the first row in every call.

Try removing the `for` loop and use the `rowIndex` parameter instead. Eg. `self.data.getValueAt(rowIndex, 'Revisado_Por')`

---

<div class="post-metadata">

**Author:** ![daniel\_bazan](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@daniel\_bazan](https://forum.inductiveautomation.com/u/daniel_bazan)\
**Post date:** [March 29, 2022, 9:33pm UTC](https://forum.inductiveautomation.com/t/configure-individual-cell-color-based-on-value-vision-power-table/57776/3 "2022-03-29T21:33:51Z")

</div>

Yes, the solution actually worked. I didnt know it run once per cell in a table.

The code in the end is the following:

```auto
valor_revisado = self.data.getValueAt(rowIndex, 'Revisado_Por')
		#print valor_revisado
	if valor_revisado != None:
		return {'background': 'white'}
	else: 
		return {'background': 'red'}

```

Thank you so much for your help and comment @gdube
