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 5973963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:52:30+00:00 2026-05-22T20:52:30+00:00

as the title means, I want my tablelayout to evenly assign each column’s width

  • 0

as the title means, I want my tablelayout to evenly assign each column’s width and the child of each column be centered inside the column. Setting android:stretchColumns="*" also, however, streches the child inside each column.

any ideas for hacking this issue?

using horizontal Linearlayout to imitate a tablerow is acceptable, but I also have no idea how to get a Linearlayout to arrange its children evenly 🙁

pls help,
thanks in advance.

  • 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-22T20:52:30+00:00Added an answer on May 22, 2026 at 8:52 pm

    No hack needed. 🙂
    Simply set the layout_width of the children to wrap_content instead of fill_parent, or to a fixed value. Set layout_gravity to center or center_horizontal.

    EDIT: Code added.

    Try this:

    <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
                 android:layout_width="fill_parent" android:layout_height="wrap_content"
                 android:shrinkColumns="*" android:stretchColumns="*">
        <TableRow>
            <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/hello"
                    android:gravity="center"
                    />
            <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/hello"
                    android:gravity="center"
                    />
            <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/hello"
                    android:gravity="center"
                    />
        </TableRow>
    </TableLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to understand what exactly the above (in my question's Title) means? This
Title says it mostly. I want to add a simple extension method to the
Like in Title I want to get position from List<Vector2> positions = new List<Vector2>{/*here
I want to get the newest entries for each of my threads (private messaging
Like the title says, I want to know what (int (*)()) in a C-define-function-call
I have a blog app and i want to show each post in a
As the title says I want to know the exact position of the item
Not sure how to title this... So I've got three child classes of Event
Everybody loves renaming columns. The title column is a favorite of mine and I
In my rootfolder/xxx/header.php page have <title>some text</title> . I want to search as like

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.