arciCZ Posted May 1, 2018 Share Posted May 1, 2018 Hello is there everyone way to add new block with table.insert or etc. local Ankety = { [0] = { ["nazev"] = "ABC", ["obsah"] = " Yeah your car", ["hlasoval"] = 1, ["Ano"] = 24, ["Ne"] = 20, }, [1] = { ["nazev"] = "ASC", ["obsah"] = ' Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer rutrum quam mauris, sed \n commodo odio auctor malesuada. Sed lacus lacus, \n semper a nisi nec, condimentum tincidunt sem. \n Aliquam et odio nulla.', ["hlasoval"] = 0, ["Ano"] = 31, ["Ne"] = 50, } } and i need with table.insert or anything make that: local Ankety = { [0] = { ["nazev"] = "ABC", ["obsah"] = " :O your :O", ["hlasoval"] = 1, ["Ano"] = 24, ["Ne"] = 20, }, [1] = { ["nazev"] = "ASC", ["obsah"] = ' Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer rutrum quam mauris, sed \n commodo odio auctor malesuada. Sed lacus lacus, \n semper a nisi nec, condimentum tincidunt sem. \n Aliquam et odio nulla.', ["hlasoval"] = 0, ["Ano"] = 31, ["Ne"] = 50, }, [2] = { ["nazev"] = "And", ["obsah"] = ' Yeah ipsum dolor sit amet, consectetur adipiscing elit. Integer rutrum quam mauris, sed \n commodo odio auctor malesuada. Sed lacus lacus, \n semper a nisi nec, condimentum tincidunt sem. \n Aliquam et odio nulla.', ["hlasoval"] = 0, ["Ano"] = 10, ["Ne"] = 15, } } Thank for help. Link to comment
MIKI785 Posted May 1, 2018 Share Posted May 1, 2018 (edited) Well yeah.. it's quite simple really. Just create a separate table with the values of the nested tables and insert it.. there's not much to it. local poll = { ["nazev"] = "And", ["obsah"] = ' Yeah ipsum dolor sit amet, consectetur adipiscing elit. Integer rutrum quam mauris, sed \n commodo odio auctor malesuada. Sed lacus lacus, \n semper a nisi nec, condimentum tincidunt sem. \n Aliquam et odio nulla.', ["hlasoval"] = 0, ["Ano"] = 10, ["Ne"] = 15, } Ankety:insert(poll) Edited May 1, 2018 by MIKI785 1 Link to comment
arciCZ Posted May 1, 2018 Author Share Posted May 1, 2018 Thank you very much, it works. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now