# Change cell colors and Re-ordering my table in Perspective

**URL:** <https://forum.inductiveautomation.com/t/change-cell-colors-and-re-ordering-my-table-in-perspective/90116>\
**Category:** Ignition\
**Tags:** database, perspective, scripting\
**Created:** [May 8, 2024, 5:08pm UTC](https://forum.inductiveautomation.com/t/change-cell-colors-and-re-ordering-my-table-in-perspective/90116 "2024-05-08T17:08:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maryam\_Saeed](https://avatars.discourse-cdn.com/v4/letter/m/a5b964/32.png) [@Maryam\_Saeed](https://forum.inductiveautomation.com/u/Maryam_Saeed)\
**Post date:** [May 8, 2024, 5:08pm UTC](https://forum.inductiveautomation.com/t/change-cell-colors-and-re-ordering-my-table-in-perspective/90116/1 "2024-05-08T17:08:07Z")

</div>

I have 3 tables in my database. Using a Select query I have fetched necessary columns and binded it to a param"Data" on my view, my data set is then converted to dictionary , added 5 columns with arithmetic calculations through scripting.  
I tried a script that works in Pycharm and reorders my list but won't work within script transform in my table

I **now need to change color of some of my cells according to a Color Reference column in my Dataset. I also need to reorder my columns before returning my script**

Any ideas how. Thanks

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 8, 2024, 5:25pm UTC](https://forum.inductiveautomation.com/t/change-cell-colors-and-re-ordering-my-table-in-perspective/90116/2 "2024-05-08T17:25:52Z")

</div>

> **[Styling Rows Based on Values | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-display-palette/perspective-table/styling-rows)**
>
> This page includes examples detailing different ways to style rows based on values using Script Transforms. Each example accomplishes similiar results through different binding and data types to change the background color of a row or individual...

The link will take you to the examples at the bottom of the document.

> I also need to reorder my columns ...

Do that in the SQL using `ORDER BY ...`
