In this example, LabelLayout is used to construct a simple input form:
<TableLayout xmlns: android = "http://schemas.android.com/apk/res/android"
Android: layout_width = "match_parent"
Android: layout_height = "match_parent"
Android: stretchColumns = "1">
<TableRow>
<TextView
Android: text = "@ string/table_layout_10_user"
Android: textStyle = "bold"
Android: gravity = "right"
Android: padding = "3dip"/>
<EditText android: id = "@ + id/username"
Android: text = "@ string/table_layout_10_username_text"
Android: padding = "3dip"
Android: scrollHorizontally = "true"/>
</TableRow>
<TableRow>
<TextView
Android: text = "@ string/table_layout_10_password"
Android: textStyle = "bold"
Android: gravity = "right"
Android: padding = "3dip"/>
<EditText android: id = "@ + id/password"
Android: text = "@ string/table_layout_10_password_text"
Android: password = "true"
Android: padding = "3dip"
Android: scrollHorizontally = "true"/>
</TableRow>
<TableRow
Android: gravity = "right">
<Button android: id = "@ + id/cancel"
Android: text = "@ string/table_layout_10_cancel"/>
<Button android: id = "@ + id/login"
Android: text = "@ string/table_layout_10_login"/>
</TableRow>
</TableLayout>
Android: stretchColumns = "1" indicates that the second column occupies the remaining space of the table. Note that the android: scrollHorizontally attribute of EditText changes the height of the row when multiple rows are entered in EditText: