B4J Question Set Column in TableView to the left ?

strupp01

Active Member
Licensed User
Longtime User
Is there a command to set the column's headings (Firma/Nachname, Zusatz/Vorname, Straße) to the left.
It is better then.

upload_2017-7-2_14-44-44.png
 

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
Try it with this code snippet

B4X:
setAlignmentColumnStyle(tw,0,"center-left")

Sub SetAlignmentColumnStyle(table As TableView, ColumnIndex As Int, Style As String)
   Dim jo As JavaObject = table
   jo.RunMethodJO("getColumns", Null).RunMethodJO("get", Array(ColumnIndex)).RunMethodJO("getStyleClass", Null).RunMethod("add", Array(Style))
End Sub
 
Upvote 0

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
it may look better if you change the style.css to this (i added padding):

B4X:
.center-left-column .label {
-fx-alignment: CENTER_LEFT;
-fx-padding: 0 0 0 10;
}
 
Upvote 0
Top