title: Programatically add view to match parent to fill TableLayout
body: <p>I am trying to dynamically create a View to act as a spacer between table rows however my view is only going as wide as the text even though I am trying to have them match parent. </p>
  
  <p><a href="https://i.stack.imgur.com/fyAaC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fyAaC.png" alt="enter image description here"></a></p>
  
  <p>I am dynamically adding to the TableLayout with </p>
  
  <pre><code>TableRow tr = new TableRow(this);    
  
  tr.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT,
  TableRow.LayoutParams.WRAP_CONTENT));
  
  LinearLayout layout = new LinearLayout(this);
  layout.setOrientation(LinearLayout.VERTICAL);
  tr.setOrientation(LinearLayout.VERTICAL);
  tr.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT));
  
  layout.setPadding(15, 15, 10, 15);
  
  TextView description = new TextView(this);
  description.setText(row.getString(TAG_DESCRIPTION));
  description.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.black));
  description.setTextSize(25);
  
  TextView dateCreated = new TextView(this);
  dateCreated.setText("Date Created: " + row.getString(TAG_DATEADDED).replace("\\", ""));
  dateCreated.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.black));
  dateCreated.setTextSize(20);
  
  TextView reportType = new TextView(this);
  reportType.setText("Report Type: " + row.getString(TAG_REPTYPE));
  reportType.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.black));
  reportType.setTextSize(20);
  
  View view = new View(this);
  view.setMinimumHeight(2);
  view.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.black));
  view.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT));
  
  layout.addView(description);
  layout.addView(dateCreated);
  layout.addView(reportType);
  layout.addView(view);
  
  tr.addView(layout);
  
  existingReports.addView(tr);
  </code></pre>
  
  <p>and I define my TableLayout in my XML with </p>
  
  <pre><code>&lt;ScrollView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignLeft="@+id/txt_numExistingReports"
      android:layout_alignStart="@+id/txt_numExistingReports"
      android:layout_below="@+id/txt_numExistingReports"
      android:layout_alignParentBottom="true"
      android:background="@android:color/white"
      android:layout_toLeftOf="@+id/home"
      android:layout_toStartOf="@+id/home"&gt;
  
      &lt;TableLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginRight="30dp"
          android:showDividers="middle"
          android:id="@+id/existingReports"
          android:layout_marginTop="5dp"
          android:divider="?android:attr/dividerHorizontal"
          android:background="@android:color/white"/&gt;
  &lt;/ScrollView&gt;
  </code></pre>