# How to change the font size of the power table using script

**URL:** <https://forum.inductiveautomation.com/t/how-to-change-the-font-size-of-the-power-table-using-script/98268>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [November 6, 2024, 11:09am UTC](https://forum.inductiveautomation.com/t/how-to-change-the-font-size-of-the-power-table-using-script/98268 "2024-11-06T11:09:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lion\_Sun](https://avatars.discourse-cdn.com/v4/letter/l/3ab097/32.png) [@Lion\_Sun](https://forum.inductiveautomation.com/u/Lion_Sun)\
**Post date:** [November 6, 2024, 11:09am UTC](https://forum.inductiveautomation.com/t/how-to-change-the-font-size-of-the-power-table-using-script/98268/1 "2024-11-06T11:09:33Z")

</div>

I want to use scripting to dynamic change the font size for a power table。

Below is the scripting under Extention Function of configureCell of this power table. I created a custom property named "Status" for this power table, and I want use this property to dynamic change the font size. But seems it doesn't work.

Anyone can help give me some advise? where is the problem.

```python
def configureCell(self, value, textValue, selected, rowIndex, colIndex, colName, rowView, colView):
    if self.Status == 'expand':
    	return {'font': Font("Dialog", 24)}
    elif self.Status == 'collapse':
		return {'font': Font("Dialog", 32)}
    else:
        pass

```

Issue detail as below:

In 'expand' status:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/5/d51dc0fbc7bac496b43ee66c057e49e8fc012445.png)

In 'collapse' status:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/2/227087292c593ef49d0fe2aa03e39c82368e6dd3.png)

The property of status is changed by a button script, but the font does not change accordingly.

---

<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:** [November 6, 2024, 1:53pm UTC](https://forum.inductiveautomation.com/t/how-to-change-the-font-size-of-the-power-table-using-script/98268/2 "2024-11-06T13:53:33Z")

</div>

I'm not sure if there are other problems with your script, but first of all, it does not look like you imported `Font`

```python
from java.awt import Font

```

---

<div class="post-metadata">

**Author:** ![Lion\_Sun](https://avatars.discourse-cdn.com/v4/letter/l/3ab097/32.png) [@Lion\_Sun](https://forum.inductiveautomation.com/u/Lion_Sun)\
**Post date:** [November 6, 2024, 4:10pm UTC](https://forum.inductiveautomation.com/t/how-to-change-the-font-size-of-the-power-table-using-script/98268/3 "2024-11-06T16:10:24Z")

</div>

Yes, I forgot add this import, I will add it to see if it works. Thank you!

---

<div class="post-metadata">

**Author:** ![Lion\_Sun](https://avatars.discourse-cdn.com/v4/letter/l/3ab097/32.png) [@Lion\_Sun](https://forum.inductiveautomation.com/u/Lion_Sun)\
**Post date:** [November 7, 2024, 2:31am UTC](https://forum.inductiveautomation.com/t/how-to-change-the-font-size-of-the-power-table-using-script/98268/4 "2024-11-07T02:31:00Z")

</div>

After I add import line，I found I still need add the Font.PLAIN, then this script works well.  
The final code will like as below:

```python
def configureCell(self, value, textValue, selected, rowIndex, colIndex, colName, rowView, colView):
    from java.awt import Font
    if self.Status == 'expand':
    	return {'font': Font("Dialog", Font.PLAIN, 24)}
    elif self.Status == 'collapse':
		return {'font': Font("Dialog", Font.PLAIN, 32)}
    else:
        pass

```

in 'expand' status:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/3/735a22b3972f682c0ec95d4838f85db8f1d81de1.png)

in 'collapse' status:

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