# Perspective Conditional format on Table Row

**URL:** <https://forum.inductiveautomation.com/t/perspective-conditional-format-on-table-row/28478>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [September 23, 2019, 6:41pm UTC](https://forum.inductiveautomation.com/t/perspective-conditional-format-on-table-row/28478 "2019-09-23T18:41:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rodrigo.mocca](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rodrigo.mocca/32/14947_2.png) [@rodrigo.mocca](https://forum.inductiveautomation.com/u/rodrigo.mocca)\
**Post date:** [September 23, 2019, 6:41pm UTC](https://forum.inductiveautomation.com/t/perspective-conditional-format-on-table-row/28478/1 "2019-09-23T18:41:41Z")

</div>

Hi,  
I’m traying to display a table based on a Named Query, and change it background color based on a cell value, but I can’t find anything to do that.  
This is my table

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/7b8a7551f077fd88f8fbc6bf6d18322646baec8c.png)  
How can I change a row background color based on his “Capacidad” value?

Thanks in advance.  
Rodrigo

---

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [November 24, 2019, 9:25pm UTC](https://forum.inductiveautomation.com/t/perspective-conditional-format-on-table-row/28478/2 "2019-11-24T21:25:36Z")

</div>

bump

---

<div class="post-metadata">

**Author:** ![grietveld](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/grietveld/32/6984_2.png) [@grietveld](https://forum.inductiveautomation.com/u/grietveld)\
**Post date:** [November 25, 2019, 1:16pm UTC](https://forum.inductiveautomation.com/t/perspective-conditional-format-on-table-row/28478/3 "2019-11-25T13:16:23Z")

</div>

You have to build a transform on the data binding to add a style value to each row. Might not be the most elegant code to get it to work, but works for us.

```auto
	import json
	recipe = value
	data = []	
	list=[]
	for row in range(len(recipe)):
		ds = recipe[row]
		a= ds.a
		b= ds.b
		c= ds.c
		if c:
			style = '#87C7E6'
		else:
			if row%2 == 1:
				style = '#FFFFFF'
			else:	
				style = '#E5E5E5'
		row={"style":{"backgroundColor":style},"value":{"a":a,"b":b,"c":c}}
		list.append(row)
	return list
```

---

<div class="post-metadata">

**Author:** ![shawn.waltz](https://avatars.discourse-cdn.com/v4/letter/s/e9a140/32.png) [@shawn.waltz](https://forum.inductiveautomation.com/u/shawn.waltz)\
**Post date:** [April 21, 2020, 1:24pm UTC](https://forum.inductiveautomation.com/t/perspective-conditional-format-on-table-row/28478/4 "2020-04-21T13:24:50Z")

</div>

Rodrigo, did you ever get that working?
