Sort the columns of a power table using scripting

Do you want to apply the sort in a way that the user can add/remove?

Or do you just want to pre-sort the data, in which case all you need is to invoke system.dataset.sort or the sortDataset expression function: sortDataset - Ignition User Manual 8.1 - Ignition Documentation