B4J Question [BANano] text alignment in SKTable (solved)

angel_

Well-Known Member
Licensed User
Longtime User
Is it possible to align text in an SKTable?, I have tried this but it does not work:

B4X:
SKTable1.Style = $"{"text-align":"center"}"$
 
Solution
Works fine here (second column the numbers are centered). I did not do the header so it would be visible. Must be something in your css (maybe the case of the the #id is wrong)

1663611749404.png


CSS:
B4X:
#if CSS
#sktable1 tbody tr td:nth-child(2) {
  text-align: center;
}
#end If

1663612056793.png


Alwaysbusy

angel_

Well-Known Member
Licensed User
Longtime User
No, it doesnn't work, I enter the code after loading the layout but it doesn't change the alignment
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
Works fine here (second column the numbers are centered). I did not do the header so it would be visible. Must be something in your css (maybe the case of the the #id is wrong)

1663611749404.png


CSS:
B4X:
#if CSS
#sktable1 tbody tr td:nth-child(2) {
  text-align: center;
}
#end If

1663612056793.png


Alwaysbusy
 
Upvote 0
Solution

angel_

Well-Known Member
Licensed User
Longtime User
You were right, it was a problem with the capitalization of the table name in CSS.

Also noticed that code swapping it doesn't work when the code is inside #If CSS, is that correct?
 
Upvote 0
Top