Table Layout in Android

Android Table Layout going to be arranged groups of views into rows and columns. You will use the <TableRow> element to build a row in the table. Each row has zero or more cells; each cell can hold one View object.

A layout that arranges its children into rows and columns. A TableLayout consists of a number of TableRow objects, each defining a row (actually, you can have other children, which will be explained below). TableLayout containers do not display border lines for their rows, columns, or cells. Each row has zero or more cells; each cell can hold one View object. The table has as many columns as the row with the most cells. A table can leave cells empty. Cells can span columns, as they can in HTML.

Main Attributes in Table Layout :

  1. android:collapseColumns
  2. android:shrinkColumns
  3. android:stretchColumns

TableLayout containers do not display border lines for their rows, columns, or cells.

Table Layout

Table Layout Example :

Activity_Main.Xml

MainActivity.Java

Output:-

Table Layout

About Jaimin Patel

I am a Web Developer. I have been blogging and researching since 1 years and like to share my knowledge and research with the world. Peace..!!

View all posts by Jaimin Patel →

Leave a Reply

Your email address will not be published. Required fields are marked *