# Power table row and cell coloring

**URL:** <https://forum.inductiveautomation.com/t/power-table-row-and-cell-coloring/15864>\
**Category:** Ignition\
**Created:** [November 3, 2017, 2:38am UTC](https://forum.inductiveautomation.com/t/power-table-row-and-cell-coloring/15864 "2017-11-03T02:38:21Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![JGJohnson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jgjohnson/32/29582_2.png) [@JGJohnson](https://forum.inductiveautomation.com/u/JGJohnson)\
**Post date:** [November 3, 2017, 2:42pm UTC](https://forum.inductiveautomation.com/t/power-table-row-and-cell-coloring/15864/9 "2017-11-03T14:42:58Z")

</div>

The way I do it is to build a dictionary of attributes, starting with the formatting of least precedence. Then I add or ‘override’ attributes with additional logic as needed.

```auto
attributes = {"background": "#FFFFFF", "foreground": "#000000"}
if rowIndex % 2 == 0:
	attributes["background"] = "#EEECE8"
if colName == "val":
	if self.data.getValueAt(rowIndex, "writeable") == True:
		attributes["background"] = "#FFFF47"
if colName == "alarm" and value is not None:
	attributes["text"] = None
elif colName == "unit" and value is None:
	attributes["text"] = None
	if self.data.getValueAt(rowIndex, "alarm") is not None:
		attributes["iconPath"] = "CustomIcons/Indicator_Red.png"
		if value < 1:
			attributes["iconPath"] = "CustomIcons/Indicator_Green.png"

return attributes

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/power-table-row-and-cell-coloring/15864)._
