This is a community forum. Don´t limit your question to a single member.
See the tutorial on how the columns are setup here. Do it the same way for your layout putting the Flags columns at the Position you want.
' The order of this lines defines the Order in the Table.
' Add your Flags Comulm after the ID Column.
B4XTable1.AddColumn("US County", B4XTable1.COLUMN_TYPE_NUMBERS)
Thank you for your advice and forgive my ignorence the B4XTable is a new issue for me . I change the column's order as you said and i put the flags column after id .I left the other code as it was .The only problem is that all id values now are zero . Any idea why ?
B4XTable1.AddColumn("Alpha2", B4XTable1.COLUMN_TYPE_TEXT).Width = 80dip
B4XTable1.AddColumn("Alpha3", B4XTable1.COLUMN_TYPE_TEXT).Width = 80dip
Dim su As StringUtils
Dim headers As List
Dim data As List = su.LoadCSV2(File.DirAssets, "world.csv", ",", headers)
B4XTable1.MaximumRowsPerPage = 10
For i = 1 To FlagsColumn.CellsLayouts.Size - 1
Dim pnl As B4XView = FlagsColumn.CellsLayouts.Get(i)
Dim iv As ImageView
pnl.AddView(iv, 5dip, 5dip, FlagsColumn.Width - 10dip, B4XTable1.RowHeight - 10dip)
Here is what I did to get it to work the way you want:
1. I changed the csv file by inserting a blank row at the second position and saved it.
2. I changed some of the code.
3. I have attached a complete working project the way you want it with the ID as the first column, Flags as the second, name as third and so on.
4, It works, but I do not know if it is the way that Erel would do it or the best way, but it works. See attached project
By the way:
You should really use code tags as you were told (you have been a member since 2012). Please do not address your questions to only Erel. That is disrespectful to the rest of the forum members as if they do not exist. Also , your question title 'to Erel question' is a poor title because it cannot be used as a search string in the forum to help someone else. It needs to be descriptive.