I'm trying to create a league table but I am struggling to align things evenly if the number goes into double figures it pushes the next one on also on different phones the table is completely out of line etc. so does any one know how I can align views evenly and center the numbers so that it doesn't knock everything out of sync.
Ideally I want it to like this:
8 team 2 5 3 10 0 8 0
9 team 2 5 3 10 0 8 0
10 team 2 5 3 10 0 8 0
11 team 2 5 3 10 0 8 0
currently its doing this
8 team 2 5 3 10 0 8 0
9 team 2 5 3 10 0 8 0
10 team 2 5 3 10 15 8 0
11 team 2 5 3 10 0 8 0
Here's my layout:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="20dip"
android:background="@drawable/bg_tablecell"
android:orientation="horizontal"
>
<TableRow>
<TextView
android:id="@+id/position"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="4dip"
android:text="@string/POS"
android:textSize="15dip"
android:textColor="@color/blue"
android:gravity="center"
/>
<TextView
android:id="@+id/TeamName"
android:layout_width="90dip"
android:layout_height="wrap_content"
android:layout_marginLeft="23dip"
android:ellipsize="end"
android:gravity="left"
android:lines="1"
android:text="@string/Team"
android:textColor="@color/blue"
android:textSize="15dip"
android:textStyle="bold"
/>
<TextView
android:id="@+id/played"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:gravity="center"
android:text="@string/Zero"
android:textColor="@color/blue"
android:textSize="15dip"
/>
<TextView
android:id="@+id/won"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="13dp"
android:gravity="center"
android:text="@string/Zero"
android:textColor="@color/blue"
android:textSize="15dip"
/>
<TextView
android:id="@+id/drawn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="13dp"
android:gravity="center"
android:text="@string/Zero"
android:textColor="@color/blue"
android:textSize="15dip"
/>
<TextView
android:id="@+id/lost"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="13dp"
android:gravity="center"
android:text="@string/Zero"
android:textColor="@color/blue"
android:textSize="15dip"
/>
<TextView
android:id="@+id/goalsFor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="13dp"
android:gravity="center"
android:text="@string/Zero"
android:textColor="@color/blue"
android:textSize="15dip"
/>
<TextView
android:id="@+id/goalsAgainst"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="13dp"
android:gravity="center"
android:text="@string/Zero"
android:textColor="@color/blue"
android:textSize="15dip"
/>
<TextView
android:id="@+id/Difference"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="13dp"
android:gravity="center"
android:text="@string/Zero"
android:textColor="@color/blue"
android:textSize="15dip"
/>
<TextView
android:id="@+id/points"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="13dp"
android:gravity="center"
android:text="@string/Zero"
android:textColor="@color/blue"
android:textSize="15dip"
/>
</TableRow>
</TableLayout>