Jump to content

How to print table within a table


Dice

Recommended Posts

Posted
outputChatBox(tab[1][1]) --> nme 
outputChatBox(tab[1][2]) --> text 
outputChatBox(tab[3][2]) --> text3 

Please do not PM me with scripting related question nor support, use the forums instead.

Posted

yeah I know that method but the thing is, I am using table.insert so the sizes can vary, how can i make sure it gets it all.

Posted

What do you mean? You want to get all items of the table or what?

Please do not PM me with scripting related question nor support, use the forums instead.

  • Moderators
Posted
for index1 = 1,#tab do 
    local tabContents = tab[index1] 
    local newString 
    for index2 = 1,#tabContents do 
        newString = tabContents[index2].. " " 
    end 
    if newString then 
        outputChatBox(newString) 
    end 
end 

You mean something like this?

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...