B4J Question [BANano] SKTable, change cell text color according to its value

angel_

Well-Known Member
Licensed User
Longtime User
I'm trying to adapt the example in this thread:


To change the color of the text in each cell based on its value but I can't access the cell, any ideas?
 
Solution
B4X:
Dim allTDs() As BANanoElement    = tblResultadosLMT.Element.Find("td")

For i = 0 To allTDs.Length - 1
    Dim Cell As BANanoElement = allTDs(i)
    Dim CellValue As Double = BANano.parseFloat(Cell.GetText)

    If CellValue > 100 Then
        Cell.SetStyle($"{"color": "green"}"$)
    Else
        Cell.SetStyle($"{"color": "red"}"$)
    End If
Next

angel_

Well-Known Member
Licensed User
Longtime User
B4X:
Dim allTDs() As BANanoElement    = tblResultadosLMT.Element.Find("td")

For i = 0 To allTDs.Length - 1
    Dim Cell As BANanoElement = allTDs(i)
    Dim CellValue As Double = BANano.parseFloat(Cell.GetText)

    If CellValue > 100 Then
        Cell.SetStyle($"{"color": "green"}"$)
    Else
        Cell.SetStyle($"{"color": "red"}"$)
    End If
Next
 
Upvote 1
Solution
Top