Tables - dynamically selecting tables to read data from?

Is it possible to pass the table name value in tableCellValue(table,row,col) from a text attribute stored in some selector actor? I noticed in the Cookbook instructions that is manually browsed and selected. The "row" and "col" do work when assigned dynamically from some other variable but I could not figure out how to pass the first value, table. (I am trying to load different values from different tables based on the user's selection).
Comments
For example (and to simplify this: we will use only one row):
In column 1 to 5 you have stored values for a background images in world 1.
In column 6 to 10 you have stored values for background images in world 2.
When you look up backgrounds for level one you would normally do:
tableCellValue(table,1,1)
tableCellValue(table,1,2)
tableCellValue(table,1,3)
tableCellValue(table,1,4)
or
tableCellValue(table,1,5)
Now in the situation sketched earlier you would do:
tableCellValue(table,1,1+((world-1)*5))
tableCellValue(table,1,2+((world-1)*5))
tableCellValue(table,1,3+((world-1)*5))
tableCellValue(table,1,4+((world-1)*5))
or
tableCellValue(table,1,5+((world-1)*5))
Now when world = 1 it wil lookup column 1 to 5 (for example for column3: 3+(world-1)*5) = 3+(1-1)*5) = 3
when world 2 is active it wil lookup 6 to 10 (for example for column3: 3+(world-1)*5) = 3+(2-1)*5) = 8
Hope that helps.
Cheers,
Ludwig
Lump Apps and My Assets
Thank you for your workaround suggestion!