# Vision Table Background Colour

**URL:** <https://forum.inductiveautomation.com/t/vision-table-background-colour/104160>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [March 25, 2025, 2:47pm UTC](https://forum.inductiveautomation.com/t/vision-table-background-colour/104160 "2025-03-25T14:47:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aval.patel](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@aval.patel](https://forum.inductiveautomation.com/u/aval.patel)\
**Post date:** [March 25, 2025, 2:47pm UTC](https://forum.inductiveautomation.com/t/vision-table-background-colour/104160/1 "2025-03-25T14:47:11Z")

</div>

I want to alter my table background colour depending on the column. I have 7 columns in the table and I want the first four to be one colour and the last 3 to be a second colour.

---

<div class="post-metadata">

**Author:** ![jared.reynolds](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@jared.reynolds](https://forum.inductiveautomation.com/u/jared.reynolds)\
**Post date:** [March 25, 2025, 2:56pm UTC](https://forum.inductiveautomation.com/t/vision-table-background-colour/104160/2 "2025-03-25T14:56:03Z")

</div>

Hey Aval,

If you go into the scripting for the power table component there will be a section labled "configureCell". Whatever script is in there will be iterated over for each cell in the table. So what you can do is just use the index of the row saying "if index between 0 and 2 return this color, else return this color". Make sure you are using a power table, the regular table component doesn't have a configure cell script.

---

<div class="post-metadata">

**Author:** ![jared.reynolds](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@jared.reynolds](https://forum.inductiveautomation.com/u/jared.reynolds)\
**Post date:** [March 25, 2025, 3:01pm UTC](https://forum.inductiveautomation.com/t/vision-table-background-colour/104160/3 "2025-03-25T15:01:31Z")

</div>

Here is an example script and the appearance.

def configureCell(self, value, textValue, selected, rowIndex, colIndex, colName, rowView, colView):

```
if rowIndex <= 2:
	return {'background': 'red'}
else:
	return {'background': 'blue'}

```

 ![Screenshot 2025-03-25 100058](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/4/a4e06f2795d1cd7eda0413d91e4246d371659648.png)

---

<div class="post-metadata">

**Author:** ![aval.patel](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@aval.patel](https://forum.inductiveautomation.com/u/aval.patel)\
**Post date:** [March 25, 2025, 3:11pm UTC](https://forum.inductiveautomation.com/t/vision-table-background-colour/104160/4 "2025-03-25T15:11:00Z")

</div>

> [@jared.reynolds](#):
>
> ```python
> if rowIndex <= 2:
> return {'background': 'red'}
> else:
> return {'background': 'blue'}
> 
> ```

It worked. Thank you

---

<div class="post-metadata">

**Author:** ![jared.reynolds](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@jared.reynolds](https://forum.inductiveautomation.com/u/jared.reynolds)\
**Post date:** [March 25, 2025, 3:40pm UTC](https://forum.inductiveautomation.com/t/vision-table-background-colour/104160/5 "2025-03-25T15:40:24Z")

</div>

No problem
