Vision Table - Center align all columns when column count is unknown

I’m working with a Vision Table (not Power Table) in Ignition and I need to set the horizontal alignment of all columns to center.

The challenge is that the dataset driving the table can change, so I don’t know how many columns will exist ahead of time. What is the best way to iterate through the columns of the Vision Table and set the column renderer to center alignment.

Ideally I’d like to run this when the dataset loads or changes. Is accessing the JTable and looping through the columnModel the correct approach, or is there a simpler method build into the Table?

Thanks!

Make sure there is data in the table. Double click on the table so that the table customizer appears and then click ok. (You can also right click on the table and select Customizers > Table Customizer). This will populate the 'Column Attributes Data' with all of the columns that are expected in the data set.

Use all of those columns in a script (likely a propertyChange script filtered for the data property). And loop through the columnHeaders adding a new row for each column to the dataset. Set the HorizontalAlignment to 0. Every column will be centererd.