B4J Question Position columns in TableView left, right, center

strupp01

Active Member
Licensed User
Longtime User
I would like to position the individual entries in the columns. For this I have used the following code:
B4X:
  SetColumnStyle(Liste_Angebot,0, "-fx-alignment: CENTER;")     'Unbedingt die Sub SetColumnStyle(Index As Int, Style As String) installieren. Sonst kommt Fehler.
   SetColumnStyle(Liste_Angebot,1, "-fx-alignment: CENTER;")     'Unbedingt die Sub SetColumnStyle(Index As Int, Style As String) installieren. Sonst kommt Fehler.
   SetColumnStyle(Liste_Angebot,2, "-fx-alignment: CENTER;")     'Unbedingt die Sub SetColumnStyle(Index As Int, Style As String) installieren. Sonst kommt Fehler.
   SetColumnStyle(Liste_Angebot,3, "-fx-alignment: CENTER;")     'Unbedingt die Sub SetColumnStyle(Index As Int, Style As String) installieren. Sonst kommt Fehler.
   SetColumnStyle(Liste_Angebot,4, "-fx-alignment: CENTER;")     'Unbedingt die Sub SetColumnStyle(Index As Int, Style As String) installieren. Sonst kommt Fehler.
   SetColumnStyle(Liste_Angebot,5, "-fx-alignment: CENTER;")     'Unbedingt die Sub SetColumnStyle(Index As Int, Style As String) installieren. Sonst kommt Fehler.
   SetColumnStyle(Liste_Angebot,6, "-fx-alignment: CENTER;")     'Unbedingt die Sub SetColumnStyle(Index As Int, Style As String) installieren. Sonst kommt Fehler.


Sub SetColumnStyle(table As TableView,Index As Int, Style As String)
   Dim jo As JavaObject = table
   Dim Column As JavaObject = jo.RunMethodJO("getColumns", Null).RunMethod("get", Array(Index))
   Column.RunMethod("setStyle", Array(Style))
End Sub
[\code]

As a result comes
[ATTACH=full][ATTACH=full]58007[/ATTACH][/ATTACH]

However, I would like the columns 'Artikel-Nr', 'Kurzbeschreibung' and 'Langtext' In addition left-centered.
Who knows the solution?
 

Attachments

  • upload_2017-7-24_14-27-32.png
    upload_2017-7-24_14-27-32.png
    8.5 KB · Views: 241
  • upload_2017-7-24_14-36-12.png
    upload_2017-7-24_14-36-12.png
    8.3 KB · Views: 165
Top