See the below AddRow Sub
Sub AddRow(Values() As String, NumberOfColumns As Int)
Dim lastRow As Int
lastRow = Table.NumberOfViews / NumberOfColumns
For i = 0 To NumberOfColumns - 1
Dim l As Label
l.Initialize("cell")
If Values(i) <> Null Then
If IsNumber(Values(i)) Then
l.Text = NumberFormat(Values(i),0,2)
l.TextColor = Colors.Red
Else
l.Text = Values(i)
l.TextColor = FontColor2
End If
End If
l.Gravity = Alignment
l.TextSize = FontSize
l.Color=Colors.White
Dim rc As RowCol
rc.Initialize
rc.Col = i
rc.Row = lastRow
l.Tag = rc
Table.AddView(l, ColumnWidth * i, RowHeight * lastRow, ColumnWidth_1, RowHeight_1)
Next
Table.Height = (Table.NumberOfViews / NumberOfColumns) * RowHeight
End Sub