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

  • Home
  • SEARCH
  • 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 8779007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:40:14+00:00 2026-06-13T19:40:14+00:00

I want a vertical and horizontal line drawn inside the a table row. i

  • 0

I want a vertical and horizontal line drawn inside the a table row.

i cant attach image

i tried drawing lines around TextView in table row but lines are not connecting properly
below is my xml and style

 <TableLayout
    android:id="@+id/traningprogram_tabla_monday"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:stretchColumns="0,1,2,3"
     >

            <TableRow
                android:id="@+id/traningprogram_tableRow_mondayHeading"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" 

                >

                <TextView
                    android:id="@+id/traningprogram_textView_mondayheadingWeek"
                    android:layout_width="0dip"
                      android:layout_weight="1"
                    android:layout_height="wrap_content"
                    android:padding="5dp"
                    android:textSize="12dp"
                    android:text="TextView" />

                <TextView
                    android:id="@+id/traningprogram_textView_mondeyheadingWeekName"
                    android:layout_width="0dp"
                    android:layout_height="25dp"
                    android:layout_weight="1"
                    android:padding="5dp"
                    android:textSize="12dp"
                    android:text="TextView" />

            </TableRow>


            <TableRow android:id="@+id/traningprogram_tableRow_workspeed" android:layout_width="wrap_content" android:layout_height="wrap_content">                    


                <TextView
                    android:id="@+id/traningprogram_textView_workspeed"
                    android:layout_width="0dip"
                     android:layout_weight="1"
                    android:layout_height="25dp"
                    android:background="@drawable/cell_shape"
                    android:padding="5dp"
                    android:text="@string/workspeed"
                    android:textSize="12dp"

                    ></TextView>

               <TextView 
                   android:background="@drawable/cell_shape" 
                   android:padding="5dp" 
                   android:id="@+id/traningprogram_textView_workspeedvalue"
                   android:layout_width="0dip" 
                   android:layout_weight="1" 
                   android:layout_height="25dp"  
                   android:textSize="12dp"
                   android:text="TextView"></TextView>

            </TableRow>


               <TableRow android:id="@+id/traningprogram_tableRow_recoveryspeed" android:layout_width="match_parent" android:layout_height="wrap_content">                    


                <TextView
                    android:id="@+id/traningprogram__textView_recoveryspeed"
                    android:layout_width="0dip"
                    android:layout_height="25dp"
                    android:layout_weight="1"
                    android:background="@drawable/cell_shape"
                    android:padding="5dp"
                     android:textSize="12dp"
                    android:text="@string/recoveryspeed" ></TextView>

                <TextView 
                    android:background="@drawable/cell_shape" 
                    android:padding="5dp" 
                    android:layout_weight="1"
                    android:textSize="12dp"
                    android:id="@+id/traningprogram_textView_recoverspeedvalue" 
                    android:layout_width="0dp" android:layout_height="25dp"  
                    android:text="TextView"></TextView>

            </TableRow>
            <TableRow android:id="@+id/traningprogram_tableRow_workduration" android:layout_width="match_parent" android:layout_height="wrap_content">                    


                <TextView
                    android:id="@+id/traningprogram_textView_workduration"
                    android:layout_width="0dip"
                    android:layout_height="25dp"
                    android:layout_weight="1"
                    android:background="@drawable/cell_shape"
                    android:padding="5dp"
                    android:textSize="12dp"
                    android:text="@string/workduration" ></TextView>

                <TextView 
                    android:background="@drawable/cell_shape" 
                    android:padding="5dp" 
                    android:layout_weight="1"
                     android:textSize="12dp"
                    android:id="@+id/textView_workdurationValue" 
                    android:layout_width="0dp" 
                    android:layout_height="25dp"  
                    android:text="TextView"></TextView>

            </TableRow>

             <TableRow android:id="@+id/traningprogram_tableRow_recoverduration" android:layout_width="match_parent" android:layout_height="wrap_content">                    


                <TextView
                    android:id="@+id/traningprogram_textViewrecoverduration"
                    android:layout_width="0dip"
                    android:layout_height="25dp"
                    android:layout_weight="1"
                    android:background="@drawable/cell_shape"
                    android:padding="3dp"
                    android:text="@string/recoveryduration" ></TextView>

                <TextView
                    android:id="@+id/traningprogram_textView_recoverydurationvalue"
                    android:layout_width="0dip"
                    android:layout_height="25dp"
                    android:layout_weight="1"
                    android:padding="3dp"
                    android:text="TextView"
                    android:textSize="12dp" />

            </TableRow>

              <TableRow android:id="@+id/traningprogram__tableRow_repe" android:layout_width="match_parent" android:layout_height="wrap_content">                    


                <TextView
                    android:id="@+id/traningprogram_textView_repes"
                    android:layout_width="0dip"
                    android:layout_height="25dp"
                    android:layout_weight="1"
                    android:background="@drawable/cell_shape"
                    android:padding="5dp"
                     android:textSize="12dp"
                    android:text="@string/reps" >
                  </TextView>
                <TextView 
                    android:background="@drawable/cell_shape" 
                    android:padding="5dp" 
                    android:id="@+id/traningprogram_textView_repes"
                     android:layout_width="0dip"
                     android:layout_weight="1" 
                     android:layout_height="25dp"  
                      android:textSize="12dp"
                     android:text="TextView"></TextView>

            </TableRow>
        </TableLayout>

drawable/cell_shape

  <?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
    <item
        android:bottom="1dp"
        android:left="-2dp"
        android:right="1dp"
        android:top="-3dp">
        <shape android:shape="rectangle" >
            <stroke
                android:width="1dp"
                android:color="#FF000000" />

            <solid android:color="#00FFFFFF" />
        </shape>
    </item>

</layer-list>

Thanks in advance for help

  • 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-13T19:40:16+00:00Added an answer on June 13, 2026 at 7:40 pm

    For horizontal line

    view v = new View(this);
                v.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, 1));
    

    For Vertical line

     view v = new View(this);
     v.setLayoutParams(new TableRow.LayoutParams(1, TableRow.LayoutParams.MATCH_PARENT));
    

    add this in your code and add it to table row Programmatically

    Edited:

    TableRow row;
    row=(TableRow)findViewById(R.id.traningprogram_tableRow_mondayHeading);
    row.addView(v);
    

    if you want to create it in xml itself use this code after your each row items(TextView)

    for Horizontal line in XML

    <View android:layout_width="match_parent"
          android:background="@android:color/red" 
                        android:layout_height="2dp" />
    

    for vertical line in XML

    <View android:layout_width="2dp"
          android:background="@android:color/red" 
          android:layout_height="match_parent"/>
    

    Try this it will work

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

Sidebar

Related Questions

I have a image with horizontal and vertical lines. In fact, this image is
Given some horizontal line segments, I want to find a vertical line which intersects
I am using Highcharts, I want to draw vertical lines on the values. Like;
I want to create a vertical line shadow over the whole page like this:
I want to draw a vertical line between the SectionIndex column and the cell
How to convert the vertical menu into horizontal? Which lines in the below-given code
I have two lines one horizontal and one vertical, I have the equations of
I want to add horizontal scrollbars to my JScrollPane, because my table right now
Desired Outcome I want to have Vertical List with custom items on the left/right
I want to use a vertical UISlider . I have no idea about how,

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.