You could try to add an empty TextView between every 2 TextViews:
int N=5;
TableRow row = (TableRow) findViewById(R.id.tableRow1);
final TextView[] myTextViews = new TextView[2 * N];
for (int i = 0; i < 2 * N; i++) {
// create a new textview
final TextView rowTextView = new TextView(this);
//set the format
rowTextView.setBackgroundColor(Color.GREEN);
rowTextView.setWidth(50);
if (i % 2 == 0) {
rowTextView.setHeight(50);
// set some properties of rowTextView or something
rowTextView.setText("this is row #" + i / 2);
}
else {
// set the space between 2 rows
rowTextView.setHeight(2);
}
// add the textview to the linearlayout
row.addView(rowTextView);
// save a reference to the textview for later
myTextViews[i] = rowTextView;
}