xml
-----------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ScrollView android:id="@+id/ScrollView01" android:layout_width="wrap_content" android:layout_height="wrap_content">
<TableLayout android:id="@+id/TableLayout01" android:layout_width="fill_parent" android:layout_height="wrap_content" android:stretchColumns="0">
<TableRow android:id="@+id/TableRow01" android:layout_width="wrap_content" android:layout_height="wrap_content">
<TextView android:id="@+id/TextView01" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text=""></TextView>
<TextView android:id="@+id/TextView02" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text=""></TextView>
<TextView android:id="@+id/TextView03" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text=""></TextView>
<TextView android:id="@+id/TextView04" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text=""></TextView>
<TextView android:id="@+id/TextView05" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text=""></TextView>
<TextView android:id="@+id/TextView06" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text=""></TextView>
<TextView android:id="@+id/TextView07" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text=""></TextView>
</TableRow>
</TableLayout>
</ScrollView>
</LinearLayout>
----------------------------------------------------------------------------------------------------------------------------
java
-----------------------------------------------------------------------------------------------------------------------------
for (i=0;i<r;i++)       
  {//begin for    
  TableLayout table = (TableLayout) findViewById(R.id.TableLayout01);
  TableRow row = new TableRow(this);
  TextView t = new TextView(this);
  TextView t2 = new TextView(this);
  TextView t3 = new TextView(this);
  TextView t4 = new TextView(this);
  TextView t5 = new TextView(this);
  TextView t6 = new TextView(this);
  TextView t7 = new TextView(this);

  t.setText("Ying Test");
  t2.setText("/");
  t3.setText("0");
  t4.setText("X");
  t5.setText("-");
  t6.setText("B");
  t7.setText("End");
  row.addView(t);
  row.addView(t2);
  row.addView(t3);
  row.addView(t4);
  row.addView(t5);
  row.addView(t6);
  row.addView(t7); 
  table.addView(row,new TableLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));

  }// end for
//////////////////////////////////////////////////////////////////////////