Table Layout with equal rows height
<p>I have created a TableLayout where I want each row to have the same height, regardless of it's content.
<strong>How can I do this?</strong></p>

<p>Here is my code. Each row element get the same width, but the heights are not equal. What am I doing wrong? </p>

<pre><code> &lt;TableLayout
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"                    android:background="@color/grey"
                android:padding="1dip" &gt;

                &lt;TableRow
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_weight="1"
                    android:background="@color/grey" &gt;

                    &lt;LinearLayout
                        android:layout_width="0dip"
                        android:layout_height="fill_parent"
                        android:layout_weight="1"
                        android:background="@color/white"
                        android:orientation="vertical" &gt;

                        &lt;TextView
                            android:layout_width="fill_parent"
                            android:layout_height="fill_parent"
                            android:layout_gravity="center_vertical"
                            android:layout_marginBottom="5dip"
                            android:layout_marginTop="2dip"
                            android:layout_weight="1"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_make"
                            android:textStyle="bold" /&gt;

                        &lt;TextView
                            android:id="@+id/carMake"
                            android:layout_width="fill_parent"
                            android:layout_height="fill_parent"
                            android:layout_gravity="center_vertical"
                            android:layout_marginLeft="1dip"
                            android:layout_weight="1"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_detail" /&gt;
                    &lt;/LinearLayout&gt;

                    &lt;LinearLayout
                        android:layout_width="0dip"
                        android:layout_height="fill_parent"
                        android:layout_weight="1"
                        android:background="@color/white"
                        android:orientation="vertical" &gt;

                        &lt;TextView
                            android:layout_width="fill_parent"
                            android:layout_height="fill_parent"
                            android:layout_gravity="center_vertical"
                            android:layout_marginBottom="5dip"
                            android:layout_marginTop="2dip"
                            android:layout_weight="1"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_model"
                            android:textStyle="bold" /&gt;

                        &lt;TextView
                            android:id="@+id/carModel"
                            android:layout_width="fill_parent"
                            android:layout_height="fill_parent"
                            android:layout_gravity="center_vertical"
                            android:layout_weight="1"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_detail" /&gt;
                    &lt;/LinearLayout&gt;

                    &lt;LinearLayout
                        android:layout_width="0dip"
                        android:layout_height="fill_parent"
                        android:layout_weight="1"
                        android:background="@color/white"
                        android:orientation="vertical" &gt;

                        &lt;TextView
                            android:layout_width="fill_parent"
                            android:layout_height="fill_parent"
                            android:layout_gravity="center_vertical"
                            android:layout_marginBottom="5dip"
                            android:layout_marginTop="2dip"
                            android:layout_weight="1"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_version"
                            android:textStyle="bold" /&gt;

                        &lt;TextView
                            android:id="@+id/carYear"
                            android:layout_width="fill_parent"
                            android:layout_height="fill_parent"
                            android:layout_gravity="center_vertical"
                            android:layout_weight="1"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_year" /&gt;
                    &lt;/LinearLayout&gt;
                &lt;/TableRow&gt;

                &lt;TableRow
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_marginTop="1dip"
                    android:layout_weight="1"
                    android:background="@color/grey" &gt;

                    &lt;LinearLayout
                        android:layout_width="0dip"
                        android:layout_height="fill_parent"
                        android:layout_weight="1"
                        android:background="@color/white"
                        android:orientation="vertical" &gt;

                        &lt;TextView
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:layout_marginBottom="5dip"
                            android:layout_marginTop="2dip"
                            android:background="@color/white"
                                android:gravity="center_horizontal"
                            android:text="@string/car_year"
                            android:textStyle="bold" /&gt;

                        &lt;TextView
                            android:id="@+id/carYear"
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_year" /&gt;
                    &lt;/LinearLayout&gt;

                    &lt;LinearLayout
                        android:layout_width="0dip"
                        android:layout_height="fill_parent"
                        android:layout_weight="1"
                        android:background="@color/white"
                        android:orientation="vertical" &gt;

                        &lt;TextView
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:layout_marginBottom="5dip"
                            android:layout_marginTop="2dip"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_mileage"
                            android:textStyle="bold" /&gt;

                        &lt;TextView
                            android:id="@+id/carYear"
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_year" /&gt;
                    &lt;/LinearLayout&gt;

                    &lt;LinearLayout
                        android:layout_width="0dip"
                        android:layout_height="fill_parent"
                        android:layout_weight="1"
                        android:background="@color/white"
                        android:orientation="vertical" &gt;

                        &lt;TextView
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:layout_marginBottom="5dip"
                            android:layout_marginTop="2dip"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_engine_capacity"
                            android:textStyle="bold" /&gt;

                        &lt;TextView
                            android:id="@+id/carYear"
                            android:layout_width="fill_parent"
                            android:layout_height="fill_parent"
                            android:layout_gravity="center_vertical"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_year" /&gt;
                    &lt;/LinearLayout&gt;
                &lt;/TableRow&gt;

                &lt;TableRow
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_marginTop="1dip"
                    android:layout_weight="1"
                    android:background="@color/grey" &gt;

                    &lt;LinearLayout
                        android:layout_width="0dip"
                        android:layout_height="fill_parent"
                        android:layout_weight="1"
                        android:background="@color/white"
                        android:orientation="vertical" &gt;

                        &lt;TextView
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:layout_marginBottom="5dip"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_engine_type"
                            android:textStyle="bold" /&gt;

                        &lt;TextView
                            android:id="@+id/carYear"
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_year" /&gt;
                    &lt;/LinearLayout&gt;

                    &lt;LinearLayout
                        android:layout_width="0dip"
                        android:layout_height="fill_parent"
                        android:layout_weight="1"
                        android:background="@color/white"
                        android:orientation="vertical" &gt;

                        &lt;TextView
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:layout_marginBottom="5dip"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_exterior_color"
                            android:textStyle="bold" /&gt;

                        &lt;TextView
                            android:id="@+id/carYear"
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_year" /&gt;
                    &lt;/LinearLayout&gt;

                    &lt;LinearLayout
                        android:layout_width="0dip"
                        android:layout_height="fill_parent"
                        android:layout_weight="1"
                        android:background="@color/white"
                        android:orientation="vertical" &gt;

                        &lt;TextView
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:layout_marginBottom="5dip"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_city"
                            android:textStyle="bold" /&gt;

                        &lt;TextView
                            android:id="@+id/carYear"
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_year" /&gt;
                    &lt;/LinearLayout&gt;
                &lt;/TableRow&gt;

                &lt;TableRow
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_marginTop="1dip"
                    android:layout_weight="1"
                    android:background="@color/grey" &gt;

                    &lt;LinearLayout
                        android:layout_width="0dip"
                        android:layout_height="fill_parent"
                        android:layout_weight="1"
                        android:background="@color/white"
                        android:orientation="vertical" &gt;

                        &lt;TextView
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:layout_marginBottom="5dip"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_transmittion"
                            android:textStyle="bold" /&gt;

                        &lt;TextView
                            android:id="@+id/carYear"
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_year" /&gt;
                    &lt;/LinearLayout&gt;

                    &lt;LinearLayout
                        android:layout_width="0dip"
                        android:layout_height="fill_parent"
                        android:layout_weight="1"
                        android:background="@color/white"
                        android:orientation="vertical" &gt;

                        &lt;TextView
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:layout_marginBottom="5dip"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_area"
                            android:textStyle="bold" /&gt;

                        &lt;TextView
                            android:id="@+id/carYear"
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_year" /&gt;
                    &lt;/LinearLayout&gt;

                        &lt;LinearLayout
                        android:layout_width="0dip"
                        android:layout_height="fill_parent"
                        android:layout_weight="1"
                        android:background="@color/white"
                        android:orientation="vertical" &gt;

                        &lt;TextView
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:layout_marginBottom="5dip"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_registered_city"
                            android:textStyle="bold" /&gt;

                        &lt;TextView
                            android:id="@+id/carYear"
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:background="@color/white"
                            android:gravity="center_horizontal"
                            android:text="@string/car_year" /&gt;
                    &lt;/LinearLayout&gt;
                &lt;/TableRow&gt;
            &lt;/TableLayout&gt;
</code></pre>
