I know it is the same question as here
But it hasn't receive an answer yet, so I try it here, becuase I need it too :)
I got an Array: (I shortend the array/code for SO)
ScrollView sv = new ScrollView(this);
TableLayout ll=new TableLayout(this);
HorizontalScrollView hsv = new HorizontalScrollView(this);
TableRow tbrow=new TableRow(this);
for(int i=0;i<mConnector.idArray.size();i++) {
tbrow=new TableRow(this);
tbrow.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT, 1));
tbrow.setBackgroundColor(Color.rgb(51, 51, 51));
ll.addView(tbrow);
}
hsv.addView(ll);
sv.addView(hsv);
setContentView(sv);
Left out the information in the Array, I don't think you need that.
But how to add borders in every row (prefer horizontal and vertical)?
I hoped this was the solution:
tbrow.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT, 1));
tbrow.setBackgroundColor(Color.rgb(51, 51, 51));
But it just colors my whole table grey.
Hope I am clear enough, and hope their is a solution.