Get the number of the previous row in a table

Hello,

I have a list of words in an app the get their position from the position of the previous word.

[lua]

 verhaal1.woord[21].x=(verhaal1.woord[20].x)+(verhaal1.woord[20].width/2)+(verhaal1.woord[21].width/2)+spacer

[/lua]

I have to enter the row numbers by hand now, is there a way to get the numbers automatically? 

The numbers is always the numbers of the current row minus 1.

Thanks.

:smiley:
for i=2, #woord do
 woord[i].x = woord[i-1].x + …
end

of course you must have set the widths and woord[1].x before

:smiley:
for i=2, #woord do
 woord[i].x = woord[i-1].x + …
end

of course you must have set the widths and woord[1].x before