<TextView android:layout_column="3" />
使用 TableRow.LayoutParams 構造函數傳入列索引:
TextView tv = new TextView(this);
TableRow.LayoutParams params = new TableRow.LayoutParams(3); // 參數即 column 索引
tv.setLayoutParams(params);
tableRow.addView(tv);
TableRow.LayoutParams(int column) 構造函數對應 layout_column。new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT, 1f) 並配合 params.span = 2(API 14+)。requestLayout() 刷新佈局。