# Table - Row Color

**URL:** <https://forum.inductiveautomation.com/t/table-row-color/3549>\
**Category:** Ignition\
**Created:** [November 3, 2011, 5:39pm UTC](https://forum.inductiveautomation.com/t/table-row-color/3549 "2011-11-03T17:39:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ypfister](https://avatars.discourse-cdn.com/v4/letter/y/f6c823/32.png) [@ypfister](https://forum.inductiveautomation.com/u/ypfister)\
**Post date:** [November 3, 2011, 5:39pm UTC](https://forum.inductiveautomation.com/t/table-row-color/3549/1 "2011-11-03T17:39:21Z")

</div>

I have a table with the parameters of a graph (pens).  
In a cell, the color of the pen is displayed, format : color(xxx,xxx,xxx,xxx)

Is there any way to colorize the row or the cell with the value of the cell ?

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/1X/8bc664f0382ec41c9e9c6e08c1d56d7c457768ea.png)

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [November 3, 2011, 5:54pm UTC](https://forum.inductiveautomation.com/t/table-row-color/3549/2 "2011-11-03T17:54:17Z")

</div>

Here is what you can do:

1. Add a dynamic property to the table called bgColorList that is a string.

2. Add the following propertyChange event script to the table component:[code]if event.propertyName == “data”:  
data = system.dataset.toPyDataSet(event.newValue)  
bgColorList = “”

3. Lastly, bind the Column Attributes Data dataset property of the table to a Cell Update binding. Select the bgcolorMap column from the row that is your color column. Press the green + to add a new row below. Select the row and click on the property link to the right hand side to bind it to the bgColorList property of the table.

That’s it! Try it out and let us know if you have any questions.

---

<div class="post-metadata">

**Author:** ![ypfister](https://avatars.discourse-cdn.com/v4/letter/y/f6c823/32.png) [@ypfister](https://forum.inductiveautomation.com/u/ypfister)\
**Post date:** [November 4, 2011, 1:27pm UTC](https://forum.inductiveautomation.com/t/table-row-color/3549/3 "2011-11-04T13:27:11Z")

</div>

the script does not work.

In the table, the value of the cell is : color(xxx,xxx,xxx,xxx).  
In the Background Columm List, the value is : java.awt.Color[r=xxx,g=xxx,b=xxx].

How to convert the value ?  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/1X/1a4c03123a934a77e15f6fdbe8dfb7ea346ca2a5.png)

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [November 4, 2011, 4:34pm UTC](https://forum.inductiveautomation.com/t/table-row-color/3549/4 "2011-11-04T16:34:54Z")

</div>

The keys in your mapping should be the exact same value as in the table. When we set the bgColorList we are using the value from the table cell which is color(x,x,x,x). I don’t know how you got a string with java.awt.Color…

My only guess is that the value in the table is not what we think. If you click on the table view button next to the data property of the table what is the data type of the column with the color? Just click on the column to see the data type below.
