title: How to align table content in Android
body: <p>I want to align content of TableLayout in android.
  I want align the table headers too. what changes needed in main.xml?</p>
  
  <pre><code>&lt;TableRow android:layout_margin="0dp" android:id="@+id/myRow"&gt; 
  &lt;TextView android:id="@+id/myTitle" android:layout_span="5" android:text="" android:layout_gravity="center_horizontal" /&gt;
  &lt;/TableRow&gt; 
  &lt;TableRow&gt; &lt;TextView android:layout_span="5" android:background="#000000" android:height="1dp" android:gravity="right" /&gt; 
   &lt;/TableRow&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/kWODx.png" alt="enter image description here"></p>