# Center columns on a powertable and save data after pushing an update to the client

**URL:** <https://forum.inductiveautomation.com/t/center-columns-on-a-powertable-and-save-data-after-pushing-an-update-to-the-client/37599>\
**Category:** Ignition\
**Created:** [August 11, 2020, 12:53pm UTC](https://forum.inductiveautomation.com/t/center-columns-on-a-powertable-and-save-data-after-pushing-an-update-to-the-client/37599 "2020-08-11T12:53:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [August 11, 2020, 12:53pm UTC](https://forum.inductiveautomation.com/t/center-columns-on-a-powertable-and-save-data-after-pushing-an-update-to-the-client/37599/1 "2020-08-11T12:53:08Z")

</div>

Good morning,

I would like to automatically center the columns on a powertable. I run the following code on the property change event of the powertable currently:

```
if event.propertyName == 'data':
    from com.jidesoft.grid import TableUtils
    from javax.swing import JTable

    tbl = event.source.parent.getComponent('tbl_offline').getTable()
    tbl.setAutoResizeMode(JTable.AUTO_RESIZE_OFF)
    TableUtils.autoResizeAllColumns(tbl)

```

The above code automatically resizes all the columns on the powertable for me. However, the columns themselves won’t be centered. Ideally I’d like to choose which columns I want to center.

##############################################################

The second “bug” I’ve noticed is if I push an update to the client, if the powertable has data on it, all the data will be erased or set to the default startup mode. Is there a way to save the data if an admin pushes out an update to all the clients?

Thank you for any help with the above.
