# Power Table Background Transparency

**URL:** <https://forum.inductiveautomation.com/t/power-table-background-transparency/48784>\
**Category:** Ignition\
**Created:** [July 13, 2021, 4:01pm UTC](https://forum.inductiveautomation.com/t/power-table-background-transparency/48784 "2021-07-13T16:01:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![OscarJ](https://avatars.discourse-cdn.com/v4/letter/o/e8c25b/32.png) [@OscarJ](https://forum.inductiveautomation.com/u/OscarJ)\
**Post date:** [July 13, 2021, 4:01pm UTC](https://forum.inductiveautomation.com/t/power-table-background-transparency/48784/1 "2021-07-13T16:01:10Z")

</div>

How can I change the background of my power table?  
In version 7.9 this code worked but in 8.1.5 it did not

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/c/ac7d3bc042ff7ddf4c3ffa98efa2d4db7030737f.png)

---

<div class="post-metadata">

**Author:** ![osolorzano](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/osolorzano/32/6432_2.png) [@osolorzano](https://forum.inductiveautomation.com/u/osolorzano)\
**Post date:** [July 13, 2021, 4:35pm UTC](https://forum.inductiveautomation.com/t/power-table-background-transparency/48784/2 "2021-07-13T16:35:58Z")

</div>

Does this work for you?

```auto
from java.awt import Color
self.setOpaque(False)
self.getTable().setBackground(Color(255,255,255,0)
self.border = None

```

---

<div class="post-metadata">

**Author:** ![OscarJ](https://avatars.discourse-cdn.com/v4/letter/o/e8c25b/32.png) [@OscarJ](https://forum.inductiveautomation.com/u/OscarJ)\
**Post date:** [July 13, 2021, 5:19pm UTC](https://forum.inductiveautomation.com/t/power-table-background-transparency/48784/3 "2021-07-13T17:19:27Z")

</div>

Yes it works but I only want to make transparent the part of the table that is not in use

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [July 13, 2021, 5:45pm UTC](https://forum.inductiveautomation.com/t/power-table-background-transparency/48784/4 "2021-07-13T17:45:01Z")

</div>

try this

```auto
from java.awt import Color
self.setOpaque(False)
self.getTable().getViewport().setBackground(Color(255,255,255,0)
self.border = None

```

---

<div class="post-metadata">

**Author:** ![OscarJ](https://avatars.discourse-cdn.com/v4/letter/o/e8c25b/32.png) [@OscarJ](https://forum.inductiveautomation.com/u/OscarJ)\
**Post date:** [July 13, 2021, 8:15pm UTC](https://forum.inductiveautomation.com/t/power-table-background-transparency/48784/5 "2021-07-13T20:15:33Z")

</div>

That didn’t work for me

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [July 13, 2021, 8:18pm UTC](https://forum.inductiveautomation.com/t/power-table-background-transparency/48784/6 "2021-07-13T20:18:14Z")

</div>

How are you calling this code? I typically put it in the `initialize` extension function. Once in there, you will have to close the window and reopen it to see the change.

---

<div class="post-metadata">

**Author:** ![OscarJ](https://avatars.discourse-cdn.com/v4/letter/o/e8c25b/32.png) [@OscarJ](https://forum.inductiveautomation.com/u/OscarJ)\
**Post date:** [July 13, 2021, 8:26pm UTC](https://forum.inductiveautomation.com/t/power-table-background-transparency/48784/7 "2021-07-13T20:26:36Z")

</div>

I put the code in initialization but it did not work, I remember that when I updated to 8.1 I put another code but it did not save it hahaha

---

<div class="post-metadata">

**Author:** ![osolorzano](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/osolorzano/32/6432_2.png) [@osolorzano](https://forum.inductiveautomation.com/u/osolorzano)\
**Post date:** [July 13, 2021, 8:52pm UTC](https://forum.inductiveautomation.com/t/power-table-background-transparency/48784/8 "2021-07-13T20:52:02Z")

</div>

You mean you want the table to be transparent in the background except for the cells that have actual data?  
You could set the background transparent like with my last bit of code and then in the configureCell extension function do something like:

```auto
	if selected:
		return {'background': self.selectionBackground}
	else:
		return {'background': 'white'}

```

There might be a better way to do this, but I couldn’t find anything in the table’s internal functions that _only_ changed the background where there weren’t cells.

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [June 7, 2022, 2:18pm UTC](https://forum.inductiveautomation.com/t/power-table-background-transparency/48784/9 "2022-06-07T14:18:29Z")

</div>

in 8.1 where would I run the code?  
I have a system events onStartup then script?

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [June 7, 2022, 2:32pm UTC](https://forum.inductiveautomation.com/t/power-table-background-transparency/48784/10 "2022-06-07T14:32:57Z")

</div>

> [@zacharyw.larson](#):
>
> in 8.1 where would I run the code?

The power table's `initialize()` function assuming you are talking about this snippet

> [@osolorzano](#):
>
> ```auto
> from java.awt import Color
> self.setOpaque(False)
> self.getTable().setBackground(Color(255,255,255,0)
> self.border = None
> 
> ```
