Two tables in a linear Layout

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Two tables in a linear Layout

Postby vikramdeshpande » Tue Jan 05, 2010 3:12 pm

I want to show two tables, Sample is

<LinearLayout>

<TableLayout>
</TableLayout>

<TableLayout>
</TableLayout>

</LinearLayout>

is it possible to have two tables next to each other?
vikramdeshpande
Junior Developer
Junior Developer
 
Posts: 14
Joined: Tue Nov 10, 2009 11:40 am
Location: India

Top

Postby serkan.dogantekin » Tue Jan 05, 2010 3:33 pm

I think you can handle with layout_weight:

<LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:weightSum="100">

<TableLayout android:layout_width="0px" android:layout_height="fill_parent" android:layout_weight="50">
</TableLayout>

<TableLayout android:layout_width="0px" android:layout_height="fill_parent" android:layout_weight="50">
</TableLayout>

</LinearLayout>

Or you can try RelativeLayout, not LinearLayout as:

<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">

<TableLayout android:id="@+id/table_left" android:align_parent_left="true">
</TableLayout>

<TableLayout android:id="@+id/table_right" android:right_of="@id/table_left">
</TableLayout>

</RelativeLayout>
serkan.dogantekin
Developer
Developer
 
Posts: 27
Joined: Thu Jun 04, 2009 6:12 pm
Location: Istanbul/Turkey

Thanks for helping

Postby vikramdeshpande » Wed Jan 06, 2010 6:27 am

Hi,

Thanks for replying.
vikramdeshpande
Junior Developer
Junior Developer
 
Posts: 14
Joined: Tue Nov 10, 2009 11:40 am
Location: India

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 4 guests