Making tables

When the game is over i am trying to show a scorecard. It will be based off of 10 points of criteria. What would be the best way to approach this?
I would have like 10 columns and about 2 rows.

A very inefficient way that i was thinking is to make it using a picture as a background and filling each and every box.

I am trying to learn about tables now, but i haven’t seen how to actually print a table on the screen.
Could someone give me an example on how to do this? [import]uid: 24708 topic_id: 19800 reply_id: 319800[/import]

best way to show this kind of things is to learn how “json” library works in corona, its pretty awesome thing

and for displaying a table values, there’s plenty of ways to do this, easiest is just a display.newText function

something like this:
[lua]local t = {
1,2,
3,4,
5,6
}
for i=#t,1,-2 do
for l = 1,#t,2 do
local txt = display.newText(t[l], 0, 0+(l-1)*50,nil,50)
local txt = display.newText(t[i], 100, 0 +(i-1)*50,nil,50)
end
end[/lua] [import]uid: 16142 topic_id: 19800 reply_id: 76766[/import]

can you explain what this says, or means?

for i=#t,1,-2 do for l = 1,#t,2 do [import]uid: 24708 topic_id: 19800 reply_id: 76774[/import]

its a for loop, its kinda hard to explain, so check lua documentation) [import]uid: 16142 topic_id: 19800 reply_id: 76775[/import]

One last question… i am trying to explore the json library.

 local t = {}  
  
 t[1] = 320  
 t[2] = 192  
 t[3] = 100  
  

I am trying to get it to say 1 , then 320… 2, then 192… then 3, then 100

all it is saying is 320 and 100.

what am i doing wrong [import]uid: 24708 topic_id: 19800 reply_id: 76776[/import]

i think i got it!

   
 local t = {}  
  
 t[1] = 1  
 t[2] = 3  
 t[3] = 5  
  
  
 for l = 1,#t,1 do   
  
 local txt = display.newText(l, 250, 0+(l-1)\*25,nil,25)  
 txt.rotation = 90  
 txt.xScale = .5  
 txt.yScale = .5  
  
 local txt = display.newText(t[l], 200, 0+(l-1)\*25,nil,25)  
 txt.rotation = 90  
 txt.xScale = .5  
 txt.yScale = .5  
  
 end  

it says above what level it is, and below it is what the score is. and i can write to the table if it is a global value.

I think i get it now. l = 1 then it goes thought the following code… then it loops back and says that l = 2 (it adds one since it is #t,1) [import]uid: 24708 topic_id: 19800 reply_id: 76781[/import]

or you can do this like that:
[lua] local t = {}

t[1] = 1
t[2] = 3
t[3] = 5

for l = 1,#t,1 do

local txt = display.newText(l …" "… t[l], 0, 0+(l-1)*25,nil,50)
txt.xScale = .5
txt.yScale = .5

end[/lua]
[import]uid: 16142 topic_id: 19800 reply_id: 76783[/import]

Ahh very good! Thanks! [import]uid: 24708 topic_id: 19800 reply_id: 76784[/import]