Q:

tablelayout edit text in column not covering full screen

I have following layout file for my dialogue fragment. The problem is that edit text in table row layout are not of same width. I want them to cover the entire width on my dialogue screen. Also I want text boxes to take only 30% of dialogue screen width and 70% for edit texts. Can someone please help me with this ?
Following is the snapshot of my dialogue window !

Following is the XML
<?xml version="1.0" encoding="utf-8"?>

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:id="@+id/address_tab"
             android:stretchColumns="1"
             android:shrinkColumns="0"
             android:background="@color/white"

    >
    <TableRow>
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_weight="1"
            android:layout_height="2dp"
            android:layout_marginTop="2dp"
            android:background="@color/darkgreen"
            android:orientation="horizontal">

        </LinearLayout>
    </TableRow>

    <TableRow android:paddingTop="20dp">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/per_salutation"
            android:layout_gravity="bottom|left"
            android:gravity="bottom"
            android:textSize="@dimen/textsize"
            android:layout_marginLeft="10dp"
            android:textColor="@color/darkgrey"
            android:text="@string/per_salutation"/>
        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|left"
            android:id="@+id/per_edit_salutation"
            android:editable="true"
            android:inputType="text"
            android:textIsSelectable="true"
            android:textSize="@dimen/textsize"
            android:gravity="top"
            android:background="@drawable/rounded_edittext"
            android:layout_marginBottom="2dp"
            />
    </TableRow>

    <TableRow>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/text_job_title"
            android:layout_marginLeft="10dp"
            android:textColor="@color/darkgrey"
            android:textSize="@dimen/textsize"
            android:layout_gravity="bottom|left"
            android:gravity="bottom"
            android:text="@string/per_job_title"/>
        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/per_edit_job_title"
            android:editable="true"
            android:textIsSelectable="true"

            android:textSize="@dimen/textsize"
            android:layout_gravity="bottom|left"
            android:gravity="top"
            android:inputType="text"
            android:background="@drawable/rounded_edittext"
            android:layout_marginBottom="2dp"
            />
    </TableRow>

    <TableRow>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/per_first_name"
            android:textSize="@dimen/textsize"
            android:textColor="@color/darkgrey"
            android:layout_marginLeft="10dp"
            android:layout_gravity="bottom|left"
            android:gravity="bottom"
            android:text="@string/per_first_name"/>
        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/per_edit_first_name"
            android:editable="true"
            android:inputType="text"
            android:textIsSelectable="true"
            android:layout_marginBottom="2dp"
            android:textSize="@dimen/textsize"
            android:layout_gravity="bottom|left"
            android:gravity="top"
            android:background="@drawable/rounded_edittext"
            />
    </TableRow>

    <TableRow>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/per_last_name"
            android:textColor="@color/darkgrey"
            android:textSize="@dimen/textsize"
            android:layout_marginLeft="10dp"
            android:layout_gravity="bottom|left"
            android:gravity="bottom"
            android:text="@string/per_last_name"/>
        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/per_edit_last_name"
            android:editable="true"
            android:inputType="text"
            android:textIsSelectable="true"
            android:textSize="@dimen/textsize"
            android:layout_gravity="bottom|left"
            android:gravity="top"
            android:layout_marginBottom="2dp"
            android:background="@drawable/rounded_edittext"
            />
    </TableRow>

    <TableRow>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/text_country"
                android:textSize="@dimen/textsize"
                android:textColor="@color/darkgrey"
                android:layout_marginLeft="10dp"
                android:layout_gravity="center|left"
                android:gravity="bottom"
                android:text="@string/per_suffix"/>

            <Spinner
                android:id="@+id/suffix_spinner"
                android:layout_width="match_parent"
                android:theme="@style/mySpinnerItemStyle"
                android:layout_height="wrap_content"
                android:entries="@array/suffix_arrays"
                android:layout_marginRight="5dp"

                />

    </TableRow>

    <TableRow>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/per_begin_letter"
            android:textColor="@color/darkgrey"
            android:textSize="@dimen/textsize"
            android:layout_marginLeft="10dp"
            android:layout_gravity="bottom|left"
            android:gravity="bottom"
            android:text="@string/per_begin_letter"/>
        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/per_edit_begin_letter"
            android:editable="true"
            android:textIsSelectable="true"
            android:layout_marginTop="10dp"
            android:inputType="text"
            android:textSize="@dimen/textsize"
            android:layout_gravity="bottom|left"
            android:gravity="top"
            android:background="@drawable/rounded_edittext"
            android:layout_marginBottom="2dp"
            />
    </TableRow>

    <TableRow>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/per_letter_salut"
            android:layout_marginLeft="10dp"
            android:textSize="@dimen/textsize"
            android:textColor="@color/darkgrey"
            android:layout_gravity="bottom|left"
            android:gravity="bottom"
            android:text="@string/per_letter_salut"/>
        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/per_edit_letter_salut"
            android:editable="true"
            android:inputType="text"
            android:textIsSelectable="true"
            android:layout_marginTop="10dp"
            android:textSize="@dimen/textsize"
            android:layout_gravity="bottom|left"
            android:background="@drawable/rounded_edittext"
            android:layout_marginBottom="2dp"
            />
    </TableRow>

    <TableRow>
        <LinearLayout android:orientation="horizontal"
                      android:layout_height="match_parent"
                      android:layout_weight="1"
                      android:paddingTop="30dp"
                      android:layout_width="wrap_content">
            <Button
                android:id="@+id/button_save_name_title"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_weight="0.5"
                android:textSize="@dimen/textsize"
                android:background="@drawable/rounded_button"
                android:layout_marginRight="5dp"
                android:textColor="@color/black"
                android:layout_marginBottom="5dp"
                android:layout_marginLeft="10dp"
                android:text="@string/dialog_box_positive_button"/>
            <Button
                android:id="@+id/button_cancel_name_title"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_weight="0.5"
                android:textSize="@dimen/textsize"
                android:background="@drawable/rounded_button"
                android:textColor="@color/black"
                android:layout_marginBottom="5dp"
                android:layout_marginRight="10dp"
                android:text="@string/dialog_box_negative_button"/>
        </LinearLayout>

    </TableRow>

</TableLayout>

A:

TableLayout positions its children into rows and columns. TableLayout containers do not display border lines for their rows, columns, or cells. The table will have as many columns as the row with the most cells. A table can leave cells empty, but cells cannot span columns, as they can in HTML
you can use android:layout_weight="1" for Edit Text
http://androidexample.com/Table_Layout_-_Android_Example/index.php?view=article_discription&aid=74&aaid=98

