I want to create a table in android with multiple column. Most of the examples I saw is with 2 columns. (I am new to Java and Android.) I need 3-4 columns and I should be able t
I assume you're talking about a TableLayout view and not a table in a database??
If so, here's an XML example of a table with three columns and three rows.
Each < TableRow > element creates a row in the table, and each view inside the element creates a "column". I've used TextViews, but they can be ImageViews, EditText, etc.
To dynamically change these in the code, you'd have something like this:
// reference the table layout
TableLayout tbl = (TableLayout)findViewById(R.id.RHE);
// delcare a new row
TableRow newRow = new TableRow(this);
// add views to the row
newRow.addView(new TextView(this)); // you would actually want to set properties on this before adding it
// add the row to the table layout
tbl.addView(newRow);