make sqlite output look more beautiful

hi

i got piece of code like this

-- open database local path = system.pathForFile("movies.sqlite", system.DocumentsDirectory) db = sqlite3.open( path ) print(path) --print all the table contents local sql = "SELECT \* FROM mymovies" for row in db:nrows(sql) do local text = row.movie.."\n"..row.year local t = display.newText(text, 20, 30 \* row.id, native.systemFont, 24) t:setTextColor(255,255,255) end db:close()

actually got from dr burton site How to Download JSON data from MySQL Using Corona SDK (thx sir for great code) its work like a charm, but i got question about how to make the output look more beautiful

for now its only look like

movie title year movie title year movie title year

how to make it more beautiful like have background color for each loop with separator line for example like this (idk how to insert img, so i try to draw it using text :stuck_out_tongue: )

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ |                                    | | movie title                        | | year                               | |\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_| \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ |                                    | | movie title                        | | year                               | |\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_| \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ |                                    | | movie title                        | | year                               | |\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_|  

is it possible and how to do it thank you :slight_smile:

This sounds like use for a widget.newTableView().

http://docs.coronalabs.com/api/library/widget/newTableView.html

And look in the sample code for SampleCode/Interface/Listview1, Listview2, Listview3, and WidgetDemo.

But in general, you need to have an idea of what you want your UI (user interface) to be.  There are countless ways of displaying content like this and as a community we have no clue what you really want.  A tableView will take some learning and work to get going, and then you can learn to style each row how you want it.  But it’s worth learning.

Rob

This sounds like use for a widget.newTableView().

http://docs.coronalabs.com/api/library/widget/newTableView.html

And look in the sample code for SampleCode/Interface/Listview1, Listview2, Listview3, and WidgetDemo.

But in general, you need to have an idea of what you want your UI (user interface) to be.  There are countless ways of displaying content like this and as a community we have no clue what you really want.  A tableView will take some learning and work to get going, and then you can learn to style each row how you want it.  But it’s worth learning.

Rob