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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:44:27+00:00 2026-06-17T21:44:27+00:00

I am attempting to place multiple TableLayout s inside of a LinearLayout . When

  • 0

I am attempting to place multiple TableLayouts inside of a LinearLayout. When I implemented the code and ran it, the display was my background image with nothing displayed on it. Not sure what happened.

Before I tried to do this, I had everything displaying correctly but it was so much text that it had to be extremely small to make everything fit. To fix this I want to do 3 TableLayouts with the middle one being a ScrollView (I will worry about implementing the ScrollView after I fix the problem at hand).

My question is how to make all 3 TableLayouts visible with each being a specific percentage of the screen.

Below is 100% of the code for this XML file.

    <LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/tableLayout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:stretchColumns="1"
    android:shrinkColumns="0"
    android:orientation="vertical"
    android:paddingLeft="16dp"
    android:paddingRight="16dp"
    android:paddingTop="70dp"
    android:paddingBottom="70dp"
    android:background="@drawable/scroll" >    

    <TableLayout
        android:layout_width="wrap_content"
        android:layout_height="0dip"
        android:layout_weight="15" >

        <TableRow
            android:id="@+id/header"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1" >

            <TextView
                android:id="@+id/category"
                android:layout_height="wrap_content"
                android:layout_width="0px"
                android:layout_weight="1"
                android:textStyle="bold"
                android:textSize="15sp"
                android:paddingTop="10dp"
                android:gravity="center_horizontal" />

            <TableLayout
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight="1" >

                <TableRow
                    android:layout_width="0dip"
                    android:layout_height="wrap_content"
                    android:layout_weight="1" >

                    <TextView
                        android:id="@+id/points"
                        android:layout_width="0dip"
                        android:layout_height="wrap_content"
                        android:layout_weight=".25"
                        android:textSize="7sp"
                        android:gravity="left" 
                        android:textStyle="bold" />
                </TableRow>

                <TableRow
                    android:layout_width="0dip"
                    android:layout_height="wrap_content"
                    android:layout_weight="1" >

                    <TextView
                        android:id="@+id/percentage"
                        android:layout_width="0dip"
                        android:layout_height="wrap_content"
                        android:layout_weight=".3"
                        android:textSize="7sp"
                        android:gravity="left"
                        android:textStyle="bold" />
                </TableRow>

                <TableRow
                    android:layout_width="0dip"
                    android:layout_height="wrap_content"
                    android:layout_weight="1" >

                    <TextView
                        android:id="@+id/total_score"
                        android:layout_width="0dip"
                        android:layout_height="wrap_content"
                        android:layout_weight=".45"
                        android:textSize="7sp"
                        android:gravity="left"
                        android:textStyle="bold" />
                </TableRow>
            </TableLayout>
        </TableRow>

        <View 
            android:layout_width="fill_parent"
            android:layout_height="1dp"       
            android:background="#000001" />

        <TableRow
            android:id="@+id/row3"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1" >

            <TextView
                android:id="@+id/imageColumn"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight="0" />

            <TextView
                android:id="@+id/questionColumn"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".45"
                android:textSize="10sp"
                android:textStyle="bold|italic"
                android:gravity="center_vertical" />

            <TextView
                android:id="@+id/answerColumn"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".3"
                android:textSize="10sp"
                android:textStyle="bold|italic"
                android:gravity="center_vertical" />

            <TextView
                android:id="@+id/verseColumn"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".25"
                android:textSize="10sp"
                android:textStyle="bold|italic"
                android:gravity="center_vertical" />
        </TableRow>
    </TableLayout>

    <ScrollView
        android:layout_width="wrap_content"
        android:layout_height="0dip"
        android:layout_weight="70" >

    <TableLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >

        <TableRow
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1" >

            <ImageView
                android:id="@+id/q1Image"
                android:layout_width="10dp"
                android:layout_height="10dp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q1Question"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".45"
                android:textSize="7sp"
                android:paddingLeft="2dp"
                android:paddingRight="2dp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q1Answer"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".3"
                android:textSize="7sp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q1Verse"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".25"
                android:textSize="7sp"
                android:layout_gravity="center_vertical" />
        </TableRow>

        <View 
            android:layout_width="fill_parent"
            android:layout_height="1dp"       
            android:background="#C2BEBF" />

        <TableRow
            android:id="@+id/row5"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:stretchColumns="0,1,2,3"
            android:layout_weight="1" >

            <ImageView
                android:id="@+id/q2Image"
                android:layout_width="10dp"
                android:layout_height="10dp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q2Question"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".45"
                android:textSize="7sp"
                android:paddingLeft="2dp"
                android:paddingRight="2dp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q2Answer"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".3"
                android:textSize="7sp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q2Verse"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".25"
                android:textSize="7sp"
                android:layout_gravity="center_vertical" />
        </TableRow>

        <View 
            android:layout_width="fill_parent"
            android:layout_height="1dp"       
            android:background="#C2BEBF" />

        <TableRow
            android:id="@+id/row6"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:stretchColumns="0,1,2,3"
            android:layout_weight="1" >

            <ImageView
                android:id="@+id/q3Image"
                android:layout_width="10dp"
                android:layout_height="10dp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q3Question"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".45"
                android:textSize="7sp"
                android:paddingLeft="2dp"
                android:paddingRight="2dp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q3Answer"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".3"
                android:textSize="7sp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q3Verse"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".25"
                android:textSize="7sp"
                android:layout_gravity="center_vertical" />
        </TableRow>

        <View 
            android:layout_width="fill_parent"
            android:layout_height="1dp"       
            android:background="#C2BEBF" />

        <TableRow
            android:id="@+id/row7"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:stretchColumns="0,1,2,3"
            android:layout_weight="1" >

            <ImageView
                android:id="@+id/q4Image"
                android:layout_width="10dp"
                android:layout_height="10dp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q4Question"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".45"
                android:textSize="7sp"
                android:paddingLeft="2dp"
                android:paddingRight="2dp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q4Answer"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".3"
                android:textSize="7sp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q4Verse"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".25"
                android:textSize="7sp"
                android:layout_gravity="center_vertical" />
        </TableRow>

        <View 
            android:layout_width="fill_parent"
            android:layout_height="1dp"       
            android:background="#C2BEBF" />

        <TableRow
            android:id="@+id/row8"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:stretchColumns="0,1,2,3"
            android:layout_weight="1" >

            <ImageView
                android:id="@+id/q5Image"
                android:layout_width="10dp"
                android:layout_height="10dp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q5Question"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".45"
                android:textSize="7sp"
                android:paddingLeft="2dp"
                android:paddingRight="2dp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q5Answer"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".3"
                android:textSize="7sp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q5Verse"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".25"
                android:textSize="7sp"
                android:layout_gravity="center_vertical" />
        </TableRow>

        <View 
            android:layout_width="fill_parent"
            android:layout_height="1dp"       
            android:background="#C2BEBF" />

        <TableRow
            android:id="@+id/row9"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:stretchColumns="0,1,2,3"
            android:layout_weight="1" >

            <ImageView
                android:id="@+id/q6Image"
                android:layout_width="10dp"
                android:layout_height="10dp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q6Question"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".45"
                android:textSize="7sp"
                android:paddingLeft="2dp"
                android:paddingRight="2dp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q6Answer"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".3"
                android:textSize="7sp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q6Verse"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".25"
                android:textSize="7sp"
                android:layout_gravity="center_vertical" />
        </TableRow>

        <View 
            android:layout_width="fill_parent"
            android:layout_height="1dp"       
            android:background="#C2BEBF" />

        <TableRow
            android:id="@+id/row10"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:stretchColumns="0,1,2,3"
            android:layout_weight="1" >

            <ImageView
                android:id="@+id/q7Image"
                android:layout_width="10dp"
                android:layout_height="10dp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q7Question"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".45"
                android:textSize="7sp"
                android:paddingLeft="2dp"
                android:paddingRight="2dp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q7Answer"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".3"
                android:textSize="7sp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q7Verse"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".25"
                android:textSize="7sp"
                android:layout_gravity="center_vertical" />
        </TableRow>

        <View 
            android:layout_width="fill_parent"
            android:layout_height="1dp"       
            android:background="#C2BEBF" />

        <TableRow
            android:id="@+id/row11"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:stretchColumns="0,1,2,3"
            android:layout_weight="1" >

            <ImageView
                android:id="@+id/q8Image"
                android:layout_width="10dp"
                android:layout_height="10dp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q8Question"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".45"
                android:textSize="7sp"
                android:paddingLeft="2dp"
                android:paddingRight="2dp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q8Answer"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".3"
                android:textSize="7sp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q8Verse"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".25"
                android:textSize="7sp"
                android:layout_gravity="center_vertical" />
        </TableRow>

        <View 
            android:layout_width="fill_parent"
            android:layout_height="1dp"       
            android:background="#C2BEBF" />

        <TableRow
            android:id="@+id/row12"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:stretchColumns="0,1,2,3"
            android:layout_weight="1" >

            <ImageView
                android:id="@+id/q9Image"
                android:layout_width="10dp"
                android:layout_height="10dp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q9Question"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".45"
                android:textSize="7sp"
                android:paddingLeft="2dp"
                android:paddingRight="2dp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q9Answer"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".3"
                android:textSize="7sp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q9Verse"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".25"
                android:textSize="7sp"
                android:layout_gravity="center_vertical" />
        </TableRow>

        <View 
            android:layout_width="fill_parent"
            android:layout_height="1dp"       
            android:background="#C2BEBF" />

        <TableRow
            android:id="@+id/row13"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:stretchColumns="0,1,2,3"
            android:layout_weight="1" >

            <ImageView
                android:id="@+id/q10Image"
                android:layout_width="10dp"
                android:layout_height="10dp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q10Question"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".45"
                android:textSize="7sp"
                android:paddingLeft="2dp"
                android:paddingRight="2dp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q10Answer"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".3"
                android:textSize="7sp"
                android:layout_gravity="center_vertical" />

            <TextView
                android:id="@+id/q10Verse"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".25"
                android:textSize="7sp"
                android:layout_gravity="center_vertical" />
        </TableRow>
    </TableLayout>
    </ScrollView>

    <TableLayout
        android:layout_width="wrap_content"
        android:layout_height="0dip"
        android:layout_weight="15" >

        <TableRow
            android:id="@+id/row14"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:stretchColumns="0,1"
            android:layout_weight="1" >

            <Button 
                android:id="@+id/mainmenuBtn"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".33"
                android:textSize="7sp" />

            <Button 
                android:id="@+id/highscoresBtn"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".33"
                android:textSize="7sp" />
            <Button 
                android:id="@+id/playBtn"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight=".34"
                android:textSize="7sp" />
        </TableRow>
    </TableLayout>
</LinearLayout>
  • 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-17T21:44:28+00:00Added an answer on June 17, 2026 at 9:44 pm

    Do you want the tables to be side by side, or on top of eachother? You have the orientation of your LinearLayout set to “vertical” now, but the width of each table as “0dip”. I imagine you want them side by side, which means the orientation of the LinearLayout should be “horizontal”, and keep your table widths as “0dip”. If you do in fact want them on top of eachother, change the width for each table to “wrap_content” or “match_parent” and the height to “0dip”.

    Vertical example

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >
    
        <TableLayout
            android:layout_width="match_parent"
            android:layout_height="0dip"
            android:layout_weight="15" >
        </TableLayout>
    
        <TableLayout
            android:layout_width="match_parent"
            android:layout_height="0dip"
            android:layout_weight="70" >
        </TableLayout>
    
        <TableLayout
            android:layout_width="match_parent"
            android:layout_height="0dip"
            android:layout_weight="15" >
        </TableLayout>
    
    </LinearLayout>
    

    Horizontal Example

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="horizontal" >
    
        <TableLayout
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1" >
        </TableLayout>
    
        <TableLayout
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1" >
        </TableLayout>
    
        <TableLayout
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1" >
        </TableLayout>
    
    </LinearLayout>
    

    Bottom table edit

       <TableLayout
            android:layout_width="match_parent"
            android:layout_height="0dip"
            android:layout_weight="15" >
    
            <TableRow
                android:id="@+id/row14"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:stretchColumns="0,1" >
    
                <Button 
                    android:id="@+id/mainmenuBtn"
                    android:layout_width="0dip"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:textSize="7sp" />
    
                <Button 
                    android:id="@+id/highscoresBtn"
                    android:layout_width="0dip"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:textSize="7sp" />
                <Button 
                    android:id="@+id/playBtn"
                    android:layout_width="0dip"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:textSize="7sp" />
            </TableRow>
        </TableLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to use background-image:url('path/to/image.png'); to place a background image in a div
I was attempting to place a image on top of another existing image in
I'm attempting to place some embed code into a Premium WordPress Theme. NOTE: I'm
I'm attempting to place an image map into a jQuery UI dialog. Initially, the
I am attempting to place multiple controllers within my template partials with AngularJS- The
Here is my code. I'm attempting to draw a simple quadrilateral, and place a
I am attempting to get a count of items in an array to place
I have a navigation list I placed inside of a , I am attempting
I'm trying to place multiple markers on a map that are provided from an
I'm attempting to implement quicksort in-place, using boost's threading facility. Unfortunately I'm getting an

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.