使用代码把视图布局设置成一列(视图在表格行里)

在xml文件中有一个tablelayout布局。在这个布局里也使用代码添加一些行。如何设置能把视图布局排成一列呢?
在XML文件中我是这样设置的:

android:layout_column="3"

那么如何用代码实现呢?比如TextView视图。

 TextView tv = new TextView(this); 
 tv.setLayoutParams(new TableRow.LayoutParams(3));

我觉得你是想找
< TableLayout xmlns: android="http://schemas.android.com/apk/res/android"

android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="3">

<TableRow>
    <TextView
        android:layout_column="1"
        android:text="Open..."
        android:padding="3dip" />
    <TextView
        android:text="Ctrl-O"
        android:gravity="right"
        android:padding="3dip" />
    <TextView
        android:text="String"
        android:gravity="right"
        android:padding="3dip" />
</TableRow> ...`