# Default table horizontal spacing for columns

**URL:** <https://forum.inductiveautomation.com/t/default-table-horizontal-spacing-for-columns/488>\
**Category:** Archived Topics\
**Created:** [January 11, 2008, 8:46pm UTC](https://forum.inductiveautomation.com/t/default-table-horizontal-spacing-for-columns/488 "2008-01-11T20:46:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlm](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@carlm](https://forum.inductiveautomation.com/u/carlm)\
**Post date:** [January 11, 2008, 8:46pm UTC](https://forum.inductiveautomation.com/t/default-table-horizontal-spacing-for-columns/488/1 "2008-01-11T20:46:04Z")

</div>

Is there a way to set the horizontal spacing of table  
columns to some DEFAULT value other than “Auto” ??

That is, to have the spacing set to say, “center” by default so i don’t have to go into the table customerizer and manual set them that way?

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [January 11, 2008, 8:49pm UTC](https://forum.inductiveautomation.com/t/default-table-horizontal-spacing-for-columns/488/2 "2008-01-11T20:49:42Z")

</div>

(FYI - this question is following up a support call - so I have a bit more context. He has a table whose underlying data’s column structure changes because the user can choose from one of various queries to run the table)

What you can do, is have the table run a script every time the data changes that re-centers all of the columns. You’d do this with a script on the table’s “propertyChange” event, such as this one:

[code]if event.propertyName==‘data’:  
# This script will run after the table’s data  
# has been reloaded, centering all columns.  
table = event.source  
data = event.newValue

```
# Loop through each column name, setting its horiz
# alignment to CENTER (0)
for c in range(data.columnCount):
	colName = data.getColumnName(c)
	attrs = table.getColumnAttributes(colName)
	attrs.horizontalAlignment = 0

# This forces the table to re-load the column settings
table.columnAttributes = table.columnAttributes[/code]

```

Hope this helps,
