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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T10:20:26+00:00 2026-06-16T10:20:26+00:00

I have this linear layout and inside the linear layout i have several text

  • 0

I have this linear layout and inside the linear layout i have several text views.
Now what i want to do is to display the info text on the left side and then the value next to it but the values should be aligned after the longest info text.

I can’t see how i can use another Linear Layout inside the linear layout.

            <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="5dp"
            android:layout_marginLeft="5dp"
            android:orientation="vertical" >

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="#ff00ff"
                android:text="Room:"
                android:textSize="12dp" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="#ff00ff"
                android:text="{value}"
                android:textSize="12dp" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="#ff00ff"
                android:text="Date:"
                android:textSize="12dp" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="#ff00ff"
                android:text="{value}"
                android:textSize="12dp" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="#ff00ff"
                android:text="Time:"
                android:textSize="12dp" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="#ff00ff"
                android:text="{value}"
                android:textSize="12dp" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="#ff00ff"
                android:text="Location"
                android:textSize="12dp" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="#ff00ff"
                android:text="{value}"
                android:textSize="12dp" />
        </LinearLayout>

Like a html table. One with the info text and then the next with the value.
The text views with the text value should be aligned after the longest info text.

Html equivalent

<table>
<tr>
<td>Room:</td>
<td>{value}</td>
</tr>
<tr>
<td>Date:</td>
<td>{value}</td>
</tr>
...
</table>

Will it be possible to align this besides putting in a fixed dp width?

  • 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-06-16T10:20:28+00:00Added an answer on June 16, 2026 at 10:20 am

    Try this code

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:background="#0099cc"
        tools:context=".FullscreenActivity" >
    
        <TableLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:orientation="vertical" >
    
            <TableRow
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" >
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:background="#ff00ff"
                    android:text="Room:"
                    android:textSize="12dp" />
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:background="#ff00ff"
                    android:text="{value}"
                    android:textSize="12dp" />
            </TableRow>
    
            <TableRow
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" >
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:background="#ff00ff"
                    android:text="Date:"
                    android:textSize="12dp" />
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:background="#ff00ff"
                    android:text="{value}"
                    android:textSize="12dp" />
            </TableRow>
    
            <TableRow
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" >
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:background="#ff00ff"
                    android:text="Time:"
                    android:textSize="12dp" />
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:background="#ff00ff"
                    android:text="{value}"
                    android:textSize="12dp" />
            </TableRow>
    
            <TableRow
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" >
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:background="#ff00ff"
                    android:text="Location"
                    android:textSize="12dp" />
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:background="#ff00ff"
                    android:text="{value}"
                    android:textSize="12dp" />
            </TableRow>
        </TableLayout>
    
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok I have a relative layout inside a linear one.Until now,the relative layout was
H have multiple TextViews inside an LinearLayout . Now I want to delete this
I have ScroolView and it's inside Linear layout. In this linear layout i added
So I want to center a text View inside a linear layout where I
I have one activity which is having linear layout and inside this layout there
I have a linear layout with this form <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical
I have a 4x1 widget that holds several ImageView views inside a LinearLayout .
I have Layout XML Like this. This is inside LinearLayout. <TableLayout android:layout_width=fill_parent android:layout_height=fill_parent> <TableRow
I have a custom LinearLayout . Inside that layout I want to place a
I would like to have two linear layouts inside a third parent layout. I

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.