Android Question

Show a table of results per update (updates defined by user)

I want to show a table of results like this one:


enter image description here

once every time time the program is updated. The tables should be in a row next to each other with the option to scroll and view all of them, two at a time(there will be two on screen at any one time).



I have an update() method that does all the work of the number crunching and provides output. So I am guessing a loop like this:


public void showResults(){
MainActivity.e1.start();
while (MainActivity.e1.getCurrentTime() < MainActivity.e1.getEndTime()){
MainActivity.e1.update();
// Print a table.
}
}



So a horizontalScrollView would be good, with a linearLayout (horizontal). My question is this:
How can I create and show a table every time an update occurs?


For example, if the user specifies 500 updates, is there a way to just say "create and show a table for each one of these updates" without manually creating tableViews in the layout?

Answer

The way I did this is to have a single TableRow inside a TableView inside a scrollView. That way I can add as many tables as is necessary for the number of updates.
A linearLayout would also have worked but TableView allows me to add tables underneath in the same view as TableRows without clogging it all up with too many LinearViews.