Your best bet is to put the data in a CSV (text file) where the items are separated by commas or any other character and use the Tableview class by @klaus to display the data with great flexibility. Here is the link: https://www.b4x.com/android/forum/threads/class-flexible-table.30649/
His latest class is version 2 where there is an example in post #1. Alternatively, you can put the data in a SQLite database table and view it using the same class.
Your text file can be as such using a semi-colon as a delimiter:
2;Monitor;100,00
10;VGA Cable;20,00
1;Stand;9,00
The data is coming from a table but I need it formatted as string
in the way that the alignment of (e.g.) the description is exactly
underneath the other. Please have a look:
Also the comma of the price should be in this kind of format.
I know exacty how many characters are allowed in one line. So
maybe this can be useful. I was thinking of 3 seperated strings with
fixed length, in which I can put the information and align the information.
I looked at the snippet and changed it a little bit and got a solution which works for me:
B4X:
Sub SpaceRight(retStr As String,HM As Int) As String
If retStr.length < HM Then
Do While retStr.Length < HM
retStr = retStr & " "
Loop
End If
If retStr.Length = HM Then
retStr = retStr
End If
If retStr.Length > HM Then
retStr = retStr.SubString2(0,HM)
End If
Return retStr
End Sub
Sub SpaceLeft(retStr As String, HM As Int) As String
If retStr.length < HM Then
Do While retStr.Length < HM
retStr = " " & retStr
Loop
End If
If retStr.Length = HM Then
retStr = retStr
End If
If retStr.Length > HM Then
retStr = retStr.SubString2(0,HM)
End If
Return retStr
End Sub