# Perspective Table - Invididual Cell Conditional Formatting

**URL:** <https://forum.inductiveautomation.com/t/perspective-table-invididual-cell-conditional-formatting/39371>\
**Category:** Ignition\
**Tags:** perspective, scripting, ignition80\
**Created:** [October 5, 2020, 1:50pm UTC](https://forum.inductiveautomation.com/t/perspective-table-invididual-cell-conditional-formatting/39371 "2020-10-05T13:50:04Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [November 18, 2020, 5:41pm UTC](https://forum.inductiveautomation.com/t/perspective-table-invididual-cell-conditional-formatting/39371/4 "2020-11-18T17:41:23Z")

</div>

A _maybe_ more maintainable variation, if you ever intend on adding other columns you need to style:

```python
	def cc_msval(v, r, c):
		style_orange = {"backgroundColor": "#F7901D"}
		style_green = {"backgroundColor": "#00AA00"}
		return {
			"value": v.getValueAt(r, c),
			"style": style_orange if v.getValueAt(r, c) < 95 else style_green
		}

	transforms = {
		"CC_msval": cc_msval
	}

	return [
		{
			value.getColumnName(col): transforms.get(value.getColumnName(col), lambda v, r, c: v.getValueAt(r, c))(value, row, col)
			for col in xrange(value.columnCount)		
		}
		for row in xrange(value.rowCount)
	]

```

You could just make a new function, add it to the `transforms` dictionary, keyed to your column name. The slightly weird syntax at the end is just a nested comprehension to build the required JSON structure.

---

_[View the full topic](https://forum.inductiveautomation.com/t/perspective-table-invididual-cell-conditional-formatting/39371)._
