Sub SetColumnAlignmentAndFormat(columnID As String)
Dim Column As B4XTableColumn = B4XTable1.GetColumn(columnID)
Dim Alignment As String
For i = 1 To Column.CellsLayouts.Size - 1
Dim pnl As B4XView = Column.CellsLayouts.Get(i)
If Column.ColumnType = 2 Then '2 is numeric
Alignment = "RIGHT"
Dim lbl As B4XView = pnl.GetView(0)
If lbl.Text <> "" Then
lbl.Text = lbl.Text.Replace(",","")
lbl.Text =Formatter.Format(lbl.Text)
End If
Else
Alignment = "LEFT"
End If
pnl.GetView(0).SetTextAlignment("CENTER", Alignment)
Next
End Sub