title: Android align button and text in a table layout
body: <p>I am trying to create a table view with a text view and a button in android. Below is my sample code ( work in progress ). As I am very new to android please help me how to arrange the text view and the button as in the image. Now I am getting button and text view. But its weird. </p>
  
  <p><strong>My Code</strong></p>
  
  <pre><code>TableLayout table = (TableLayout)findViewById(R.id.tableLayout_1);          
  for (int i = 0; i&lt;30; i++) 
  {
  
   TableRow row = new TableRow(this);
   row.setBackgroundColor(Color.DKGRAY);
   TextView tv = new TextView(this);
   Button btn=new Button(this);
  
   tv.setTextAppearance(getApplicationContext(), R.style.maxWid);
   tv.setText("Sample Text Here");
  
   row.addView(tv);
   btn.setText("Approves");
   row.addView(btn);
   table.addView(row);
  
   }
  </code></pre>
  
  <p><strong>Style.xml</strong></p>
  
  <pre><code>&lt;style name="maxWid"&gt;
      &lt;item name="android:textStyle"&gt;bold|italic&lt;/item&gt;
      &lt;item name="android:textColor"&gt;#FFFFFF&lt;/item&gt;
      &lt;item name="android:layout_width"&gt;fill_parent&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p><strong>main_layout.xml</strong></p>
  
  <pre><code>&lt;ScrollView
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:scrollbars="vertical"
      android:layout_weight="1"&gt;
  
      &lt;TableLayout  
      android:id="@+id/tableLayout_1"  
      android:layout_width="match_parent"  
      android:layout_height="match_parent"  
      android:shrinkColumns="*"  
      android:stretchColumns="*"
      android:layout_marginLeft="10dp"
      android:layout_marginRight="10dp"
  
      &gt;  
  
      &lt;/TableLayout&gt;  
  
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p><strong>Expected format</strong>
  <img src="https://i.stack.imgur.com/lR4ra.png" alt="enter image description here"></p>
  
  <p>Fighting with this since 1 day.. Please help 
  Thanks in advance!</p>