Sub MakeTable() As ABMTable
Dim R As List
R.Initialize
Tbl.Initialize(page,"chemtbl",False,False,True,"mytheme")
Tbl.SetHeaders(Array As String ("Chemical","Select","Rate","Units","Batch No."))
Tbl.SetColumnWidths(Array As Int(200,1,15,15,50)) ' Auto column width = 0 see https://www.b4x.com/android/forum/threads/ambtable-autowidth-columns.120184/#post-751577
Tbl.SetColumnVisible(Array As Boolean (True,True,True,True,True))
Dim defUnit As String = Act.ChemUnits.GetCurrID
For i = 0 To MaxChems-1
Chem(i).InitializeWithSize(page,"chem"&i,ABM.INPUT_text,"",0,0,0,200,200,200,False,"")
SelBut(i).InitializeFloating(page,"selbut"&i,"mdi-navigation-more-horiz","")
Rate(i).InitializeWithSize(page,"rate"&i,ABM.INPUT_NUMBER,"",0,0,0,15,15,15,False,"")
Unit(i).InitializeWithSize(page,"unit"&i,"",100,0,0,0,7,7,7,"")
Batch(i).InitializeWithSize(page,"batch"&i,ABM.INPUT_TEXT,"",0,0,0,50,50,50,False,"")
Chem(i).Narrow=False
SelBut(i).UseFullCellWidth=False
Rate(i).NumberStep=1
Act.ChemUnits.FillCombo(page,Unit(i),"ID")
Unit(i).SetActiveItemId(defUnit)
R.Clear
R.Add(Chem(i))
R.Add(SelBut(i))
R.Add(Rate(i))
R.Add(Unit(i))
R.Add(Batch(i))
Tbl.AddRow("R"&i,R)
Next
Return Tbl
End Sub