0% found this document useful (0 votes)
39 views

How To Create A Table by Using TableLayout in Android Studio

The document defines the layout of a table with multiple rows and columns using XML tags. Each cell can display text and has attributes for things like width, height, color and alignment.

Uploaded by

yikom vasu
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

How To Create A Table by Using TableLayout in Android Studio

The document defines the layout of a table with multiple rows and columns using XML tags. Each cell can display text and has attributes for things like width, height, color and alignment.

Uploaded by

yikom vasu
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

<TableLayout xmlns:android="http://schemas.android.

com/apk/res/android"

android:layout_width="fill_parent"
android:layout_height="match_parent"
android:stretchColumns="0,1,2"
android:gravity="center">

<TableRow
android:background="#FFFFFF"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
android:layout_weight="1"
>
<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
android:layout_weight="1"
>

</TableRow>
</TableRow>
<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
android:layout_weight="1"

>

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text=" Date "
android:layout_margin="1dp"
android:layout_column="0"
android:background="#FFFFFF"
android:textStyle="bold"
android:gravity="center"
/>

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Miles "
android:layout_margin="1dp"
android:layout_column="1"
android:background="#FFFFFF"
android:gravity="center"
android:textStyle="bold"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Calories"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:textStyle="bold"
android:layout_column="2"
/>
</TableRow>

<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
android:layout_weight="1"
>

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text=" Text"
android:layout_margin="1dp"
android:layout_column="0"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text=" Text"
android:layout_margin="1dp"
android:layout_column="1"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text=" Text"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:layout_column="2" />
</TableRow>

<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
android:layout_weight="1"
>

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text=" Text"
android:layout_margin="1dp"
android:layout_column="0"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text=" Text"
android:layout_margin="1dp"
android:layout_column="1"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text=" Text"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:layout_column="2" />
</TableRow>

<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
android:layout_weight="1"
>

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text=" Text"
android:layout_margin="1dp"
android:layout_column="0"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text=" Text"
android:layout_margin="1dp"
android:layout_column="1"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text=" Text"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:layout_column="2" />
</TableRow>

</TableLayout>

You might also like