# Color cells of a table based on content \[Vision\]

**URL:** <https://forum.inductiveautomation.com/t/color-cells-of-a-table-based-on-content-vision/99222>\
**Category:** Ignition\
**Tags:** database, vision, scripting\
**Created:** [November 28, 2024, 9:11am UTC](https://forum.inductiveautomation.com/t/color-cells-of-a-table-based-on-content-vision/99222 "2024-11-28T09:11:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hert0ne](https://avatars.discourse-cdn.com/v4/letter/h/f9ae1b/32.png) [@hert0ne](https://forum.inductiveautomation.com/u/hert0ne)\
**Post date:** [November 28, 2024, 9:11am UTC](https://forum.inductiveautomation.com/t/color-cells-of-a-table-based-on-content-vision/99222/1 "2024-11-28T09:11:40Z")

</div>

I have a table populated with a SQL Query containing values that vary from 'OK' if the parameter is accepted, 'X' if it isn't measured and a float/integer if the parameter is not accepted therefore returns the measure error.

 ![immagine_2024-11-28_100602449](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/3/933ca7d51f8a1c8fbfbbc6f5acc285674e7d3def.png)

I would like to color the single cells that contain numbers to showcase the wrong parameters and make it easier to recognise them quickly.  
I tried using many methods: `propertyChange` scripts, the built-in background mapping function, property bindings etc. but i haven't managed to successfully do it.

If any other info is needed I'm open to share. Thanks.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 28, 2024, 2:36pm UTC](https://forum.inductiveautomation.com/t/color-cells-of-a-table-based-on-content-vision/99222/2 "2024-11-28T14:36:12Z")

</div>

Use a Power Table and write a [configureCell](https://www.docs.inductiveautomation.com/docs/8.1/appendix/components/vision-components/tables/power-table/power-table-scripting-functions#configurecell) extension script for it. It will be called for every displayed cell and can customize the display.

Make sure that the script does no tag reads or SQL callouts or API calls--it doesn't have time for that. If you need more information than what is already present in the table's data, use custom properties on the component to pull in all the extra information you need, in bulk, then look up the right parts in the script.

---

<div class="post-metadata">

**Author:** ![hert0ne](https://avatars.discourse-cdn.com/v4/letter/h/f9ae1b/32.png) [@hert0ne](https://forum.inductiveautomation.com/u/hert0ne)\
**Post date:** [November 29, 2024, 1:13pm UTC](https://forum.inductiveautomation.com/t/color-cells-of-a-table-based-on-content-vision/99222/3 "2024-11-29T13:13:35Z")

</div>

I ended up using the `getBackgroundAt` method in the normal table because I didn't notice your reply. Will definetly try `configureCell` if I'll have some more complex cell personalization issues. Thanks!
