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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:04:15+00:00 2026-06-01T16:04:15+00:00

I am having trouble getting a table row implemented. My coding is not allowing

  • 0

I am having trouble getting a table row implemented. My coding is not allowing me add custom widths to my editText controls. Can someone please point out what the problem might be for table tableRow2? I want the feet and inches editText to be beside each other with a width of 40dp. Thanks in advance!

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout01" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:orientation="horizontal">

<TableRow android:layout_height="wrap_content" android:id="@+id/tableRow1"
    android:padding="5dp" android:layout_width="fill_parent">

    <TextView android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:text="@string/grainBinType"
        android:textSize="14sp" />

    <Spinner android:id="@+id/spinner1" android:layout_height="wrap_content"
        android:layout_width="200dp" android:paddingLeft="8dp"
        android:entries="@array/grainBinTypes" android:prompt="@string/rfDefault" />

</TableRow>

<TableRow android:layout_height="wrap_content" android:id="@+id/tableRow2"
    android:padding="5dp" android:layout_width="wrap_content">

    <TextView android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:text="@string/radiusOfBin"
        android:textSize="14sp" android:paddingRight="8dp" />

    <EditText android:id="@+id/editTextFeet"
        android:layout_width="40dp" android:layout_height="wrap_content"
        android:inputType="number" android:textColor="#008000" android:ems="10"
        android:paddingRight="8dp" />

    <TextView android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:text="@string/feet"
        android:textSize="14sp" android:paddingRight="8dp" />

    <EditText android:id="@+id/editTextinches"
        android:layout_width="40dp" android:layout_height="wrap_content"
        android:inputType="number" android:textColor="#008000" android:ems="10" />

    <TextView android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:text="@string/inches"
        android:textSize="14sp" />
</TableRow>

  • 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-01T16:04:16+00:00Added an answer on June 1, 2026 at 4:04 pm

    Firstly if we use tablelayout then we usually use table row and in each table row all the elements must be equal. I means in your first table you have two elements and in second you have five. that is the problem. in the first table row change the width of spinner 40dp will also effect it to Edittext….
    I suggest you to use LinearLayout for your requirement…

    Use below code

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/LinearLayout01"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical" >
    <LinearLayout android:layout_height="wrap_content" android:id="@+id/tableRow1"
        android:padding="5dp" android:layout_width="fill_parent">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/grainBinType"
            android:textSize="14sp" />
        <Spinner android:id="@+id/spinner1" android:layout_height="wrap_content"
            android:layout_width="200dp" android:paddingLeft="8dp"
            android:entries="@array/grainBinTypes" android:prompt="@string/rfDefault" />
    
    </LinearLayout>
    
    
    
    <LinearLayout
        android:id="@+id/tableRow2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="5dp" >
    
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingRight="8dp"
            android:text="@string/radiusOfBin"
            android:textSize="14sp" />
    
        <EditText
            android:id="@+id/editTextFeet"
            android:layout_width="40dp"
            android:layout_height="wrap_content"
            android:ems="10"
            android:inputType="number"
            android:paddingRight="8dp"
            android:textColor="#008000" />
    
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingRight="8dp"
            android:text="@string/feet"
            android:textSize="14sp" />
    
        <EditText
            android:id="@+id/editTextinches"
            android:layout_width="40dp"
            android:layout_height="wrap_content"
            android:ems="10"
            android:inputType="number"
            android:textColor="#008000" />
    
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/inches"
            android:textSize="14sp" />
    </LinearLayout>
    
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble getting my table to behave. The content keeps overflowing and my
I'm having some trouble getting my Table and Colspans to work. I'm trying to
I'm having trouble getting a decent query time out of a large MySQL table,
I have a table as below, I'm having trouble getting the results I want.
I want to display a settings table modally, but I'm having trouble getting navigation
I'm trying to create a table-less layout using floats, but I'm having trouble getting
im having trouble getting a popup using javascript to show table data onmouseover when
I am having trouble with my table in ruby. I am allowing a user
I am having trouble getting the input values of dynamically created controls in a
I'm having trouble getting a rotary encoder to work properly with AVR micro controllers.

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.