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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:24:58+00:00 2026-05-16T21:24:58+00:00

I’m trying to create tables with rounded corners. I’ve quite a bit of XML

  • 0

I’m trying to create tables with rounded corners. I’ve quite a bit of XML to do this, but I have a problem. The table is wrapping itself to the width of its inner text. I want the entire thing to fill the parent (though I want a border around it so there is some cushion, which I have). I can’t understand why it is not when I have everything to fill_parent. Could someone point out what is wrong?

Here’s a screenshot of what I mean and a copy of my XML:

screenshot 1

shape_outer.xml

<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="#0000FF"/>
    <corners android:radius="5px"/>
    <padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" /> 
</shape>

shape_inner.xml

<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="#FFFFFF"/>
    <corners android:radius="5px"/>
    <padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" /> 
</shape>

my layout:

<?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"
    >
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="47px"
        style="?android:attr/windowTitleBackgroundStyle"
        android:gravity="center">
        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="My title"
            style="?android:attr/windowTitleStyle"
            android:paddingLeft="5px" />
    </LinearLayout>
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="1"
        android:padding="10px"
        >
        <!-- used so we can separate two tables -->
        <TableLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:stretchColumns="1"
            >
            <!-- first table -->
            <TableRow android:paddingBottom="10px">
                <!-- outer border -->
                <TableLayout
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:stretchColumns="1"
                    android:padding="2px"
                    android:background="@drawable/shape_outer"
                    >
                    <TableRow>
                        <!-- inner whitespace -->
                        <TableLayout
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:stretchColumns="1"
                            android:layout_weight="1"
                            android:background="@drawable/shape_inner"
                            android:padding="10px"
                            >
                            <TableRow>
                                <!-- first row: one -->
                                <LinearLayout
                                    android:orientation="horizontal"
                                    android:layout_width="fill_parent"
                                    android:layout_height="wrap_content"
                                    android:gravity="left|center_vertical"
                                    >
                                    <TextView 
                                        android:layout_width="70px"
                                        android:layout_height="wrap_content"
                                        android:layout_column="1"
                                        android:text="One:"
                                        android:padding="6dip"
                                        android:textColor="#000000" />
                                    <TextView 
                                        android:id="@+id/one"
                                        android:layout_width="fill_parent"
                                        android:layout_height="wrap_content"
                                        android:layout_column="1"
                                        android:text="sadflkjaasasdfadsdsf;lkjdsal;asdj"
                                        android:padding="6dip"
                                        android:textColor="#000000"
                                        android:maxLines="1" />
                                </LinearLayout>
                            </TableRow>
                            <!-- separator -->
                            <View
                                android:layout_height="1dip"
                                android:background="#FF909090" />
                            <TableRow>
                                <!-- second row: two -->
                                <LinearLayout
                                    android:orientation="horizontal"
                                    android:layout_width="fill_parent"
                                    android:layout_height="wrap_content"
                                    android:gravity="left|center_vertical"
                                    >
                                    <TextView 
                                        android:layout_width="70px"
                                        android:layout_height="wrap_content"
                                        android:layout_column="1"
                                        android:text="Two:"
                                        android:padding="6dip"
                                        android:textColor="#000000" />
                                    <TextView 
                                        android:id="@+id/two"
                                        android:layout_width="fill_parent"
                                        android:layout_height="wrap_content"
                                        android:layout_column="1"
                                        android:text="asdfasdasdfasdfasfasdfasgeargfsgsfd"
                                        android:padding="6dip"
                                        android:textColor="#000000"
                                        android:maxLines="1" />
                                </LinearLayout>
                            </TableRow>
                        </TableLayout>
                    </TableRow>
                </TableLayout>
            </TableRow>
            <!-- second table -->
            <TableRow>
                <!-- outer border -->
                <TableLayout
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:stretchColumns="1"
                    android:padding="2px"
                    android:background="@drawable/shape_outer"
                    >
                    <TableRow>
                        <!-- inner white space -->
                        <TableLayout
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:stretchColumns="1"
                            android:background="@drawable/shape_inner"
                            android:padding="10px"
                            >
                            <!-- third row: Three -->
                            <TableRow>
                                <LinearLayout
                                    android:orientation="horizontal"
                                    android:layout_width="fill_parent"
                                    android:layout_height="wrap_content"
                                    android:gravity="left|center_vertical"
                                    >
                                    <TextView 
                                        android:layout_width="70px"
                                        android:layout_height="wrap_content"
                                        android:layout_column="1"
                                        android:text="Three:"
                                        android:padding="6dip"
                                        android:textColor="#000000" />
                                    <TextView 
                                        android:id="@+id/three"
                                        android:layout_width="fill_parent"
                                        android:layout_height="wrap_content"
                                        android:layout_column="1"
                                        android:text="asdfasfasdfasgeargfsgsfd"
                                        android:padding="6dip"
                                        android:textColor="#000000"
                                        android:singleLine="true"
                                        android:ellipsize="end" />
                                </LinearLayout>
                            </TableRow>
                            <!-- separator -->
                            <View
                                android:layout_height="1dip"
                                android:background="#FF909090" />
                            <!-- second row: four -->
                            <TableRow>
                                <LinearLayout
                                    android:orientation="horizontal"
                                    android:layout_width="fill_parent"
                                    android:layout_height="wrap_content"
                                    android:gravity="left|center_vertical"
                                    >
                                    <TextView 
                                        android:layout_width="70px"
                                        android:layout_height="wrap_content"
                                        android:layout_column="1"
                                        android:text="Four:"
                                        android:padding="6dip"
                                        android:textColor="#000000" />
                                    <TextView 
                                        android:id="@+id/four"
                                        android:layout_width="fill_parent"
                                        android:layout_height="wrap_content"
                                        android:layout_column="1"
                                        android:text="aasdfasfasdfasgeargfsgsfd"
                                        android:padding="6dip"
                                        android:textColor="#000000"
                                        android:singleLine="true"
                                        android:ellipsize="end" />
                                </LinearLayout>
                            </TableRow>
                        </TableLayout>
                    </TableRow>
                </TableLayout>
            </TableRow>
        </TableLayout>
    </LinearLayout>
</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-05-16T21:25:00+00:00Added an answer on May 16, 2026 at 9:25 pm

    The use of tables was convoluted and pointless. Here is my working XML:

    <?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="wrap_content"
        android:paddingTop="10dip"
        android:paddingBottom="10dip"
        android:paddingLeft="15dip"
        android:paddingRight="15dip"
        >
        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:padding="2dip"
            android:background="@drawable/shape_outer"
            >
            <LinearLayout
                android:orientation="vertical"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/shape_inner"
                >
                <LinearLayout
                    android:orientation="horizontal"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:gravity="left|center_vertical"
                    android:padding="10dip"
                    >
                    <TextView 
                        android:layout_width="70dip"
                        android:layout_height="wrap_content"
                        android:text="One:"
                        android:padding="6dip"
                        android:textColor="#000000"
                        android:gravity="right" />
                    <TextView 
                        android:id="@+id/one"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:padding="6dip"
                        android:textColor="#000000"
                        android:text="sdklafjalfkjaslgkjafds"
                        android:maxLines="1"
                        android:ellipsize="end" />
                </LinearLayout>
                <View
                    android:layout_height="1dip"
                    android:layout_width="fill_parent"
                    android:background="#FF909090"
                    android:padding="10dip" />
                <LinearLayout
                    android:orientation="horizontal"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:gravity="left|center_vertical"
                    android:padding="10dip"
                    >
                    <TextView 
                        android:layout_width="70dip"
                        android:layout_height="wrap_content"
                        android:text="Two:"
                        android:padding="6dip"
                        android:textColor="#000000"
                        android:gravity="right" />
                    <TextView 
                        android:id="@+id/two"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:padding="6dip"
                        android:textColor="#000000"
                        android:text="dsaklfajsdkldsafjsf"
                        android:maxLines="1"
                        android:ellipsize="end" />
                </LinearLayout>
            </LinearLayout>
        </LinearLayout>
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.