# Perspective fill in table with values and styles

**URL:** <https://forum.inductiveautomation.com/t/perspective-fill-in-table-with-values-and-styles/40901>\
**Category:** Ignition\
**Tags:** perspective, scripting, ignition80\
**Created:** [November 23, 2020, 6:45pm UTC](https://forum.inductiveautomation.com/t/perspective-fill-in-table-with-values-and-styles/40901 "2020-11-23T18:45:58Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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 23, 2020, 7:30pm UTC](https://forum.inductiveautomation.com/t/perspective-fill-in-table-with-values-and-styles/40901/2 "2020-11-23T19:30:38Z")

</div>

The generally recommended approach is to retrieve your data at the top level of the binding (via query, HTTP binding, whatever) and then use a script transform - you can loop through the result rows and add a style key as appropriate. Take a look at this thread for some inspiration; it's a bit more complicated than you might need (supporting per-column cell styling) but should be an inspiration:

> [@Perspective Table - Invididual Cell Conditional Formatting](http://forum.inductiveautomation.com/t/perspective-table-invididual-cell-conditional-formatting/39371/4):
>
> A maybe more maintainable variation, if you ever intend on adding other columns you need to style: 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))(v…

---

_[View the full topic](https://forum.inductiveautomation.com/t/perspective-fill-in-table-with-values-and-styles/40901)._
