Hi All.
I have the following code:
I get the following result, there is a space between the green and yellow lines
due to the following line of code:
if i delete the line the result is the following:
I would like the following result:
Any suggestion ?
Thank you
Marco
I have the following code:
B4X:
Dim sb As StringBuilder
sb.Initialize
'Giorno
Dim TitleCellStyle As String = "color=black width=600 VerticalAlignment=center"
Dim TitlePStyle As String = "[p alignment=center][color=white][b]"
sb.Append($"
[table Alignment=Left rows=${1} cols=1]
this is the header row
[row RepeatHeader=True]
[cell ${TitleCellStyle}]${TitlePStyle}Dieta Diversa - Sabato 23 Aprile 2022[/b][/color][/p][/cell]
[/row]
"$)
sb.Append("[/table]")
'Per Test
Dim tipo As List
tipo.Initialize
tipo.Add("COLAZIONE")
tipo.Add("SPUNTINO1")
tipo.Add("SPUNTINO2")
'ciclo per Pranzo , spuntino, etc
For ii = 0 To 2
'Tipo Pasto
Dim TitleCellStyle As String = "color=green width=600 VerticalAlignment=center"
Dim TitlePStyle As String = "[p alignment=left][color=black][b]"
sb.Append($"
[table Alignment=Left rows=${1} cols=1]
this is the header row
[row RepeatHeader=True]
[cell ${TitleCellStyle}]${TitlePStyle}${tipo.Get(ii)}[/b][/color][/p][/cell]
[/row]
"$)
sb.Append("[/table]")
'Una riga vuota
sb.Append($"[p] [/p]"$)
'Il contenuto del Pasto + Note + eventuali GR
Dim items As List
items.Initialize
For i = 1 To 20
items.Add(Array("Item " & i, Rnd(1, 100), Rnd(100, 1000)))
Next
......
Dim TitleCellStyle As String = "color=yellow width=200 VerticalAlignment=center"
Dim TitlePStyle As String = "[p alignment=center][color=black][b]"
sb.Append($"
[table Alignment=Center rows=${1 + items.Size} cols=3]
this is the header row
[row RepeatHeader=True]
[cell ${TitleCellStyle}]${TitlePStyle}Cosa[/b][/color][/p][/cell]
[cell ${TitleCellStyle}]${TitlePStyle}Note[/b][/color][/p][/cell]
[cell ${TitleCellStyle}]${TitlePStyle}Gr[/b][/color][/p][/cell]
[/row]
"$)
For Each row() As Object In items
sb.Append($"
[row height=10]
[cell][p alignment=center]${row(0)}[/p][/cell]
[cell][p alignment=center]${row(1)}[/p][/cell]
[cell][p alignment=center]$${row(2)}[/p][/cell]
[/row]
"$)
Next
sb.Append("[/table]")
Next
Return sb.ToString
I get the following result, there is a space between the green and yellow lines
due to the following line of code:
B4X:
'Una riga vuota
sb.Append($"[p] [/p]"$)
if i delete the line the result is the following:
I would like the following result:
Any suggestion ?
Thank you
Marco