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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:48:57+00:00 2026-06-11T01:48:57+00:00

i want to create a tablelayout within the code. Every n-th row should be

  • 0

i want to create a tablelayout within the code.
Every n-th row should be a Headline with only one textview. The other rows should contain 3 textviews. All first, second and third views should be the same width of course.

my problem now is that the width of the first column is set by the broadest texview which is the headline, but that’s way to big for the first views of the other rows. so i would like to combine the cells of the row, where the headline is located, so it can span over the whole row. and the other cells should be the size of the broadest text.

this is how it should look

______________________________
|Long Title__________________|
|x___|YYYY_____|ZZZ__________|
|XXX_|YYYYYYYYY|ZZZZ_________|
|xxxx|YYYYY____|ZZZ__________|
|xxx_|YY_______|Z____________|
|Long Title__________________|
|x___|YYYY_____|ZZZ__________|
|XXX_|YYYYYYYYY|ZZZZ_________|
|xxxx|YYYYY____|ZZZ__________|
|xxx_|YY_______|Z____________|

this is how it looks atm

______________________________
|Long Title__________________|
|x_________|YYYY_____|ZZZ____|
|XXX_______|YYYYYYYYY|ZZZZ___|
|xxxx______|YYYYY____|ZZZ____|
|xxx_______|YY_______|Z______|
|Long Title__________________|
|x_________|YYYY_____|ZZZ____|
|XXX_______|YYYYYYYYY|ZZZZ___|
|xxxx______|YYYYY____|ZZZ____|
|xxx_______|YY_______|Z______|

would be great if someone can help me.

  • 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-11T01:48:59+00:00Added an answer on June 11, 2026 at 1:48 am

    the following code can help. Just add another Linear Layout block to have 3 rows.

        <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" >
    
    <TextView
        android:id = "@+id/Textviewtitle"
        android:layout_width="fill_parent"
        android:layout_alignParentLeft="true"
        android:layout_height="wrap_content"
        android:text="@string/hello_world"
        tools:context=".TestActivity" />
    
    <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="90dp"
         android:layout_alignLeft="@+id/Textviewtitle"
         android:layout_below="@+id/Textviewtitle"
         android:orientation="horizontal">
    
     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
         xmlns:tools="http://schemas.android.com/tools"
         android:layout_width="fill_parent"
         android:layout_weight="1"
         android:layout_height="wrap_content"
         android:orientation="vertical">
    
     <TextView
        android:id = "@+id/Textview1"
        android:layout_width="wrap_content"
        android:layout_weight="1"
        android:layout_height="wrap_content"
        android:text="@string/hello_world"
        tools:context=".TestActivity" />
     <TextView
        android:id = "@+id/Textview2"
        android:layout_width="wrap_content"
        android:layout_weight="1"
        android:layout_height="wrap_content"
        android:text="@string/hello_world"
        tools:context=".TestActivity" />
     <TextView
        android:id = "@+id/Textview3"
        android:layout_width="wrap_content"
        android:layout_weight="1"
        android:layout_height="wrap_content"
        android:text="@string/hello_world"
        tools:context=".TestActivity" />
    
    
    
     </LinearLayout>
    
     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_weight="1"
    android:layout_height="wrap_content"
    android:orientation="vertical">
    
     <TextView
        android:id = "@+id/Textview4"
        android:layout_width="wrap_content"
        android:layout_weight="1"
        android:layout_height="wrap_content"
        android:text="@string/hello_world"
        tools:context=".TestActivity" />
     <TextView
        android:id = "@+id/Textview5"
        android:layout_width="wrap_content"
        android:layout_weight="1"
        android:layout_height="wrap_content"
        android:text="@string/hello_world"
        tools:context=".TestActivity" />
     <TextView
        android:id = "@+id/Textview6"
        android:layout_width="wrap_content"
        android:layout_weight="1"
        android:layout_height="wrap_content"
        android:text="@string/hello_world"
        tools:context=".TestActivity" />
     </LinearLayout>
    
    </LinearLayout>
    
     </RelativeLayout>
    

    Use the following links for more reference on aligning. Once you add the 3rd Linear Layout block , with weight 1, it will align perfectly.

    http://developer.android.com/reference/android/widget/RelativeLayout.LayoutParams.html

    http://developer.android.com/reference/android/widget/LinearLayout.LayoutParams.html

    Repeating the same, you can get another 3 block row.

    Please see the edit. you can use something like this

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

Sidebar

Related Questions

Im trying to create a TableLayout dynamically. I want to create rows and columns
I want to crate custom TableLayout with rows like this: TV is for TextView,
I want to create a table layout with custom table rows. Those rows should
I want to add rows to a tablelayout dynamically. This is my code. TableRow
I create a TableLayout dynamically via code and want to set a margin between
I want to create ExpandableListView. It contains 2 rows, the row children are textviews
i want create Dynamic Slideshow in Jquery i'm Write this code var ctx =
I want create module which update list of usb devices automatically (not only mass
I want to create the following layout which should be 100% in landscape form
showtimeTable = new TableLayout(this); showtimeTable.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); for(int i=0;i<object.dateList.size();i++){ /* Create a new row

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.