title: Center a TextView in a TableRow in a TableLayout
body: <p>I am trying to build something like a header. I tried using <code>android:gravity="center"</code> and <code>android:textAlignment="center"</code> on the TextView but it doesn't center the text. I don't know where the problem is.</p>
  
  <pre><code>&lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context=".MainActivity" &gt;
  
  &lt;TableRow
      android:id="@+id/tableRow1"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="#008000" &gt;
  
      &lt;TextView
          android:id="@+id/HeaderTextView"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          &lt;!--android:textAlignment="center"
          android:gravity="center"--&gt;
          android:text="@string/header"
          android:textAppearance="?android:attr/textAppearanceLarge"
          android:textColor="#FFF"
          android:textStyle="italic" /&gt;
  
  &lt;/TableRow&gt;
  
  &lt;/TableLayout&gt;
  </code></pre>