I have application in the android. The interfaces depend on tablelayout
, each row in which the content differs from the other.
I want to show 5 columns in some rows ... how can that be?
Asked
Active
Viewed 1,608 times
-2

mohammd qandeel
- 1
- 4
1 Answers
0
You can have a variable number of columns in each row, here's an example:
<TableLayout
android:layout_width="wrap_content"
android:stretchColumns="*"
android:layout_height="wrap_content">
<!-- First row has 5 columns -->
<TableRow>
<TextView
android:layout_column="1"
android:text="Column 1" />
<TextView
android:layout_column="2"
android:text="Column 2" />
<TextView
android:layout_column="3"
android:text="Column 3"/>
<TextView
android:layout_column="4"
android:text="Column 4"/>
<TextView
android:layout_column="5"
android:text="Column 5" />
</TableRow>
<!-- Second row has 3 columns -->
<TableRow>
<TextView
android:layout_column="1"
android:text="Column 1" />
<TextView
android:layout_column="2"
android:text="Column 2" />
<TextView
android:layout_column="3"
android:text="Column 3"/>
</TableRow>
</TableLayout>

Matheus Fróes
- 141
- 10
-
You can put any view inside the tablerow `