You can use the code in this example to show data in tabular form.
The table is made of two main views. The header row is made of a panel with labels. The main cells component is made of a ScrollView with labels as the cells.
You can modify the code to change the table appearance.
Some of the settings can be changed in Sub Globals:
Code:
'Table settings
HeaderColor = Colors.Gray
NumberOfColumns = 4
RowHeight = 30dip
TableColor = Colors.White
FontColor = Colors.Black
HeaderFontColor = Colors.White
FontSize = 14
Adding data to the table:
Code:
'add header
SetHeader(Array As String("Col1", "Col2", "Col3", "Col4"))
'add rows
For i = 1 To 100
AddRow(Array As String(i, "Some text", i * 2, "abc"))
Next
'set the value of a specific cell
SetCell(0, 3, "New value")
'get the value
Log("Cell (1, 2) value = " & GetCell(1, 2))
Table events:
Code:
Sub Cell_Click
Dim rc As RowCol
Dim l As Label
l = Sender
rc = l.Tag
activity.Title = "Cell clicked: (" & rc.Row & ", " & rc.Col & ")"
End Sub
Sub Header_Click
Dim l As Label
Dim col As Int
l = Sender
col = l.Tag
Activity.Title = "Header clicked: " & col
End Sub
The code is not too complicated and you can further customize it as needed.
Files: TableExample.zip doesn't include CSV functionality, however it can be used with Basic4android trial version.
TableExample1.1.zip depends on StringUtils library.
TableExample - v1.2 which also shows the grid lines, made by klaus, is available here: http://www.basic4ppc.com/forum/basic...html#post43670