Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7171775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:28:54+00:00 2026-05-28T15:28:54+00:00

I use TableLayout with android. <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent> <TableLayout

  • 0

I use TableLayout with android.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical" android:layout_width="fill_parent"
  android:layout_height="fill_parent">

  <TableLayout
    android:id="@+id/tableLayout1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true" >

    <TableRow
        android:id="@+id/tableRow1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >

        <TextView
            android:layout_column="1"
            android:text="@string/client"
            android:width="150px"
            style="@style/Infos" />

        <TextView
            android:id="@+id/client"
            android:layout_column="2"
            android:width="200px"
            style="@style/InfosPrincipale" />

        <TextView
            android:layout_column="3"
            android:text="@string/site"
            android:width="150px"
            style="@style/Infos" />

        <TextView
            android:id="@+id/site"
            android:layout_column="4"
            android:width="200px"
            style="@style/InfosPrincipale" />
    </TableRow>

 ....

The result is a table with 4 columns of determined width.

I use a tablet and it’s pretty in portrait mode but not in landscape because it use half of the screen, and I imagine that it would be ugly on phone version.

I have allways the same layout, 2 textview which are linked together. (they must be on the same line)

Is there a layout in Android which permits to show depending the size of the screen 2 or 4 columns ? or is there a way to set a 25% width on each column ? (it would be a good start)

regards

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T15:28:56+00:00Added an answer on May 28, 2026 at 3:28 pm

    Really, you don’t even need to set the weightSum to 1.

    Set each cell layout_weight (sic!) to 25,

    each cell layout_width to 0dp (doesn’t work without it!) and

    weightSum for the Row to 100.

    Even more, you could escape weightSum setting totally, but layout would be more slow.
    As for changing the table structure according to orientation, you can do it in code only.
    I don’t see what you want to do with your poor columns, but you could change their visibility to GONE and back to VISIBLE. And you’ll see so many as remain visible. But weightSum then should not be set. Or change it together with columns visibility.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For a widget I use a simple layout which contains a TableLayout <?xml version=1.0
I'm learning android development and I'm doing a minesweeper. So I use a tableLayout
use LWP::Simple; use Parallel::ForkManager; @links=( [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-2.1-windows.exe,SweetHome3D-2.1-windows.exe], [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-2.1-macosx.dmg,SweetHome3D-2.1-macosx.dmg], [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3DViewer-2.1.zip,SweetHome3DViewer-2.1.zip], ); # Max 30 processes for
I got some trouble with the TableLayout Android. I wanna create a table with
I'm using a TableLayout in Android. Right now I have one TableRow with two
I use tablelayout instead of the custom header title bar Now my layout like
I do not want to use TableLayout because my data model and UI perfectly
I am designing custom dialogue in android, For this purpose I designed xml file
I have a TableLayout that is created programmatically in an Android project. I keep
EDIT: Does TableLayout not work properly? I see most of you say use relative

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.