Displaying a league table

Hello.
I am trying to display a league table that would look something like this:
image

I am trying to use TableView extension:

I get a table where every character is in seperate row:

How do i fix this? I am also open to change the way i display table (withouth TableView)

Thank you for your time

Your code snippet is all but impossible to understand Blaz.

You can seek-out the error by running the App in the Companion and right-mouse click 'Do it' on suspect Blocks to see what data they really hold.

You need to set the row delimiter to \n in the Tableview settings (designer) - assumes a line return is your row delimiter...

1 Like

Thank you so much. This mostly solves my problem.
The only thing now is that Team names always contain comma (,) so TableView thinks they are two different columns. Any idea how to fix this?

Never mind I solved it by just deleting comma be


fore.

Thank you again for your help.

An example (without a sort function), that is string based and might serve you better:
LeagueTable.aia (21.4 KB)

Here, the team name is the TinyDb Tag. Example Data Stored:
;Arsenal,4,4,0,12 where ';' is the row separator and ',' is the column separator.

The data is collected via a 'For' loop and used to populate a 'Rows String' (which you can apply a sort to).

Thank you. Works great!

... and here is an example that sorts the Table by Points, using a bubble sort defined in Blocks (No extension or JavaScript required). The Procedure is based on an example by Sajal Dutta:
https://imagnity.com/tutorials/app-inventor/list-sorting-on-app-inventor/

LeagueTableSorted.aia (24.0 KB)

Screenshot

Note, the values of the rows in relation to each other are nonsense, just there to show how to sort a table by column. Of course, you can expand this to sort by Points, then by Goal Difference.

Thank you! I implemented this sorting alghoritem and it works great. Its also very simple to add sorting via multiple columns. You saved me A LOT of time.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.