Need help with a Table

I have a table that looks like this:

  ▼  {
                    [1] = "MasonX890",
                    [2] = "X",
                    [3] = "XX",
                    [4] = "XXX"

How can I make the tables data look like this when ever new data is added (and the current data in it)

  ▼  {
[1] = { [1] = "MasonX890",[2] = "X",  [3] = "XX",   [4] = "XXX"},
[2] = { [1] = "MasonX890",[2] = "X",  [3] = "XX",   [4] = "XXX"}}

I mean you’re basically just creating a dictionary, so just insert both tables into a new empty table.

1 Like
local tableThatHoldsTablesWithData = {}
local tableWithData = {
  name = 'dr doobinfsmurch'
}
-- two methods
table.insert(tableThatHoldsTablesWithData, tableWithData) 
-- automatically finds an empty index and adds the table to it

tableThatHoldsTablesWithData[1] = tableWithData 
-- ofc change the one to whatever index you want
2 Likes