Implementing Table View in Android
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4542655/android-table-view">Android table view</a>  </p>
</blockquote>



<p>I have pretty much the same question as was <a href="http://stackoverflow.com/questions/4542655/android-table-view">asked here</a> a year ago - how to implement table view widget in a nice manner, like on <a href="http://sourceforge.net/dbimage.php?id=194965" rel="nofollow">this screenshot</a>. There wasn't a good answer to that question, so reposting.</p>

<p>I used <code>ListView</code> with a <code>LinearLayout</code> as its row, which contains several <code>TextView</code> elements and an <code>ImageView</code>. But the trouble is that each row is completely independent from the others in terms of column width. If a column in one row has text that's longer than in another, the two won't be aligned vertically. And <code>GridView</code> doesn't seem to be appropriate for my case, because it is meant to display homogenious data that is stored in a list and just display it in the columns - like grid of pictures. Any idea how this could be implemented? Thanks.</p>

<p><strong>Update.</strong>
OK, I've just found a solution <a href="http://stackoverflow.com/a/4987097/714011">here</a>. In my Linear layout for a table row, despite setting <code>android:layout_weight</code> I was mistakenly setting <code>android:layout_width</code> to <code>wrap_content</code>. Setting it to <code>0dip</code> made all TextView's in the LinearLayout have the same width in every row. Here's the example of my row:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:padding="6dip"&gt;
&lt;TextView
    android:id="@+id/toptext"
    android:layout_width="0dip"
    android:layout_height="fill_parent"
    android:layout_weight="2"
    android:textSize="24sp"
/&gt;
&lt;TextView
    android:id="@+id/bottomtext"
    android:layout_width="0dip"
    android:layout_height="fill_parent"
    android:layout_weight="3"
    android:textSize="24sp" 
/&gt;
&lt;ImageView
    android:id="@+id/play"
    android:layout_width="wrap_content"
    android:layout_height="fill_parent"
    android:src="@drawable/play_1"
    android:clickable="true"
/&gt;
&lt;/LinearLayout&gt;
</code></pre>
