Don, your thread is about iTableview for B4I, iOS.Check this thread. This should bring you further. Or at least you should see a way to do it.
https://www.b4x.com/android/forum/threads/tableview-with-custom-items.51205/#content
OUPS. Dammit. Sorry, did not make sure to check if it is B4JThis thread is about iTableview for B4I, iOS.
.table-view{
-fx-table-cell-border-color: Black;
-fx-font-family: Consolas;
-fx-font-size: 10px;
-fx-text-weight: Bold;
-fx-background-insets: 0, 0 0 0 0;
-fx-padding: 0;
}
.table-view:focused{
-fx-border-Width: 0;
-fx-table-cell-border-color: Black;
-fx-background-insets: 0, 0 0 0 0;
-fx-padding: 0;
}
/* TableView Column Header */
.table-view .column-header-background{
-fx-background-color: linear-gradient(#ff0000 0%, #00ff00 100%);
}
.table-view .column-header-background .label{
-fx-background-color: transparent;
-fx-font-size: 12px;
-fx-text-fill: White;
-fx-font-weight: Bold;
}
.table-view .column-header {
-fx-table-cell-border-color: transparent;
-fx-background-color: transparent;
}
.table-view .table-cell{
-fx-background-color: transparent;
-fx-table-cell-border-color: #a2a2a2;
-fx-text-fill: White;
-fx-font-size: 12px;
}
.table-row-cell{
-fx-background-color: -fx-table-cell-border-color, #0000ff;
-fx-background-insets: 0, 0 0 0 0;
-fx-padding: 0;
-fx-cell-size: 16px;
}
.table-row-cell:odd{
-fx-background-color: -fx-table-cell-border-color, #00ff00;
-fx-background-insets: 0, 0 0 0 0;
-fx-padding: 0;
}
.table-row-cell:selected {
-fx-background-color: linear-gradient(#2a2a2a 0%, #6c6c6c 20%, #a8a8a8 40%, #6c6c6c 70%, #2a2a2a 100%);
-fx-background-insets: 0;
-fx-background-radius: 0;
}
.table-view > .virtual-flow > .scroll-bar:vertical,
.table-view > .virtual-flow > .scroll-bar:vertical > .track,
.table-view > .virtual-flow > .scroll-bar:vertical > .track-background,
.table-view > .virtual-flow > .scroll-bar:horizontal,
.table-view > .virtual-flow > .scroll-bar:horizontal > .track,
.table-view > .virtual-flow > .scroll-bar:horizontal > .track-background {
-fx-background-color: #1a1a1a;
-fx-table-cell-border-color: #0f0f0f;
}
.table-view{
-fx-table-cell-border-color: Black;
-fx-font-family: Consolas;
-fx-font-size: 10px;
-fx-text-weight: Bold;
-fx-background-insets: 0, 0 0 0 0;
-fx-padding: 0;
}
.table-view:focused{
-fx-border-Width: 0;
-fx-table-cell-border-color: Black;
-fx-background-insets: 0, 0 0 0 0;
-fx-padding: 0;
}
/* TableView Column Header */
.table-view .column-header-background{
-fx-background-color: linear-gradient(#000000 0%, #0000ff 100%);
}
.table-view .column-header-background .label{
-fx-background-color: transparent;
-fx-font-size: 12px;
-fx-text-fill: White;
-fx-font-weight: Bold;
}
.table-view .column-header {
-fx-table-cell-border-color: transparent;
-fx-background-color: transparent;
}
.table-view .table-cell{
-fx-background-color: transparent;
-fx-table-cell-border-color: #00ff00;
-fx-text-fill: White;
-fx-font-size: 12px;
}
.table-row-cell{
-fx-background-color: -fx-table-cell-border-color, #1a1a1a;
-fx-background-insets: 0, 0 0 0 0;
-fx-padding: 0;
-fx-cell-size: 16px;
}
.table-row-cell:odd{
-fx-background-color: -fx-table-cell-border-color, #1e1e1e;
-fx-background-insets: 0, 0 0 0 0;
-fx-padding: 0;
}
.table-row-cell:selected {
-fx-background-color: linear-gradient(#2a2a2a 0%, #6c6c6c 20%, #a8a8a8 40%, #6c6c6c 70%, #2a2a2a 100%);
-fx-background-insets: 0;
-fx-background-radius: 0;
}
.table-view > .virtual-flow > .scroll-bar:vertical,
.table-view > .virtual-flow > .scroll-bar:vertical > .track,
.table-view > .virtual-flow > .scroll-bar:vertical > .track-background,
.table-view > .virtual-flow > .scroll-bar:horizontal,
.table-view > .virtual-flow > .scroll-bar:horizontal > .track,
.table-view > .virtual-flow > .scroll-bar:horizontal > .track-background {
-fx-background-color: #1a1a1a;
-fx-table-cell-border-color: #0f0f0f;
}
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("lay11") 'Load the layout file.
MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "tb.css"))
MainForm.Show
Dim cols As List
cols = asJO(TableView1).RunMethodJO("getColumns",Null)
Dim cnt As Int = 1
For Each col As JavaObject In cols
col.RunMethodJO("getStyleClass",Null).RunMethod("add",Array("col"&cnt))
cnt = cnt + 1
Next
TableView1.Items.Add(Array(1,2,4))
TableView1.Items.Add(Array(2,2,3))
TableView1.Items.Add(Array(3,2,2))
TableView1.Items.Add(Array(4,2,1))
End Sub
Sub asJO(o As JavaObject) As JavaObject
Return o
End Sub
.table-view .column-header.col1 .label {
-fx-background-color: red;
}
.table-view .column-header.col2 .label {
-fx-background-color: green;
}
.table-view .column-header.col3 .label {
-fx-background-color: blue;
}
.table-view .column-header.col1 .label {
-fx-background-color: red;
}
.table-view .column-header.col2 .label {
-fx-background-color: green;
}
.table-view .column-header.col3 .label {
-fx-background-color: blue;
}
Sub SetColumnHeaderStyle(tv As TableView, Index As Int, Style As String)
Dim jo As JavaObject = tv
Dim Column As JavaObject = jo.RunMethodJO("getColumns", Null).RunMethod("get", Array(Index))
Column.RunMethodJO("getStyleClass",Null).RunMethod("add",Array(Style))
Column.RunMethodJO("getStyleClass",Null).RunMethod("add",Array("header" & Style))
End Sub
.table-view .column-header.xxxxxx .label {
-fx-background-color: darkgrey;
}
.table-view .column-header.yyyyyy .label {
-fx-background-color: lightgrey;
}
.table-view .column-header.headerxxxxxx {
-fx-background-color: darkgrey;
}
.table-view .column-header.headeryyyyyy {
-fx-background-color: lightgrey;
}
MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "tv.css"))