Table Layout

1107 views.

Android TableLayout 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.

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

Following are the important attributes specific to TableLayout –
android:id

This is the ID which uniquely identifies the layout.
android:collapseColumns

This specifies the zero-based index of the columns to collapse. The column indices must be separated by a comma: 1, 2, 5.
android:stretchColumns

The zero-based index of the columns to stretch. The column indices must be separated by a comma: 1, 2, 5.

Activity_Main.xml

MainActivity.java

OutPut:

1 2

You may also like...

Leave a Reply