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

2) Write A Program To Display 10 Students Basic Information in A Table Form Using Table Layout.

The document shows an XML code for displaying basic information of 10 students in a table layout. It defines the table structure with rows and columns to display name, roll number and department for each student.

Uploaded by

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

2) Write A Program To Display 10 Students Basic Information in A Table Form Using Table Layout.

The document shows an XML code for displaying basic information of 10 students in a table layout. It defines the table structure with rows and columns to display name, roll number and department for each student.

Uploaded by

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

2) Write a program to display 10 students basic information in a table form using

Table Layout.
Exp-6 ans:activitymain.xml

<?xml version="1.0" encoding="utf-8"?>


<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TableRow>

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name" />

<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="roll no" />

<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="dept" />

</TableRow>

<TableRow>
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="abc" />

<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="123" />

<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="comp" />

</TableRow>

<TableRow>

<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="def" />

<TextView
android:id="@+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="456" />

<TextView
android:id="@+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="comp" />

</TableRow>
<!--add more<TableRow>to add 10 students data-->
</TableLayout>

You might also like