Spanning columns with TableLayout [duplicate] Spanning columns with TableLayout [duplicate] android android

Spanning columns with TableLayout [duplicate]


add android:layout_span="3" to span 3 columns.For example:

        <TableRow>            <Button android:id="@+id/item_id"                android:layout_span="2"                android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:text="item text" />             </TableRow>


android:layout_span does the trick.

example:

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"android:layout_height="fill_parent"><TableRow>    <TextView android:id="@+id/info"        android:layout_span="2"        android:text="some text"        android:padding="3dip"        android:layout_gravity="center_horizontal" /></TableRow><TableRow>    <TextView android:text="some other text"         android:padding="3dip" />    <TextView android:text="more text"         android:padding="3dip" /></TableRow></TableLayout>