NewestStackOverflowUser NewestStackOverflowUser - 20 days ago 8
Android Question

How to display a scrolling table inside a activity?

I'm quite new in Android programming so I want to ask what is the best way to display data in a table full with rows and columns. Also it should be able to be scrolled down to view more rows.

Here is a simple paint drawing of the way I imagine my data_activity.xml



In each column and row I will show a different number (maybe string).

Just want some guidance about this maybe a tutorial or code if existing.

zed zed
Answer

You can use a ScrollView. And place inside it a TableLayout. This will allow the TableLayout to be scrolled.

Check this example of TableLayout: http://www.mkyong.com/android/android-tablelayout-example/ TableLayout doc: http://developer.android.com/reference/android/widget/TableLayout.html

Comments