Is there and any method to make table like html in android where i can set row column width as we do in html
<table >
<tr><td style="width:'50%;"></td>
<td style="width:'50%;"></td>
</tr>
</table>
<TableLayout
android:id="@+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="3" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
</TableLayout>
Edit 1:
For something like Html there the percentage width works with respect to its Parent
but the weight introduced in Android works with respect to the screen size available for root.
You can use a LinearLayout and the weight attribute to achive this.
The child elements in your Rows can each be given a weight as a portion of the sum (a percentage). Be sure to set the layout_width to "0dp"
Check out this previous question Linear Layout and weight in Android
The TableLayout has properties similar to LinearLayout. I did some tweek on it too. To better say it, see my sample code below. Hope its useful.