'AVMCFD is the name of the column
' SetColumnAlignment("AVMCFD", "BOTTOM", "RIGHT") 'vert, hor
' SetColumnAlignment("AVMCFD", "TOP", "RIGHT") 'vert, hor
' SetColumnAlignment("AVMCFD", "CENTER", "LEFT") 'vert, hor
SetColumnAlignment("AVMCFD", "CENTER", "RIGHT") 'vert, hor AVMCFD is the name of the column
Sub SetColumnAlignment(columnID As String, alignmentV As String, alignmentH As String)
Dim column As B4XTableColumn = B4XTable1.GetColumn(columnID)
For i = 1 To column.CellsLayouts.Size - 1 'starts at 1 due to header
Dim pnl As B4XView = column.CellsLayouts.Get(i)
I will clarify this point. B4XTable creates the cells when needed. This means that when the table is resized more cells will be created. This is not an issue in B4A as the table is created and usually never resized (until the activity is recreated which means that the table is recreated as well).
In B4J and B4i you cannot assume that new cells will not be created. There are two ways to "solve" it.
This code sets the maximum number of rows and then forces the table to create cells for this number of rows. You can of course change it to whichever number you like. 20 is probably large enough.
You can safely modify the cells after this call. New cells will never be created.
2. Update the cells in DataUpdate event.
I recommend to use option #1 in B4A as well, as the cells are not immediately created by default.
Numbers padding with * has been the sole useful option,
Padding with blanks makes the output to be centred in the column.
Iwould like to pad with blanks ,but it needs a visible character.
Before i tried to write the values into a listview centered right.
THE VALUES IN LISTVIEW LOOK WELL, but copying the value to the column it automoves center.
In resume columns with variable number of caracters in a defined column width always shown centered..