Have you ever been jealous of how pretty SQL consoles prints? Here gfxTables to help you!
- lua table to gfxTable and vice versa
- Simple API
- Easy to work with
-
📡 Get a copy of srt.lua from the Official Repository or From Luarocks
-
💾 Copy
gfxTables.lua
where you like to use it, or just on the root directory of the project -
⚙ Add it to your project like this:
local gfxTables = require("path/to/gfx/Tables")
-
📃 Create a new table object:
local coolTable = gfxTables.newTable()
-
🎮 Play with it's api to see how it works
coolTable:setShowEnumerator(true) --Now in the left side will be a number indexing items --Starting from 1 jus like god intended coolTable:setDefaultEntryValue("empty") --When a cell has not been defined it will print "empty" coolTable:setPadding(2) --2 spaces between walls and text coolTable:insertColumns("First Name", "Last Name", "Email") --Now the table contains 3 columns use :inserttColumn() for finer --control on individual columns coolTable:insertEntry({"Alejandro", "Alzate", "[email protected]"}) --Not joking just print it directly print(coolTable)
-
💎 Look at that beauty and profit!
local gfxTables = require("gfxTables") local coolTable = gfxTables.newTable() coolTable:setShowEnumerator(true) coolTable:setSeparateEntries(true) coolTable:setDefaultEntryValue("empty") coolTable:setPadding(2) coolTable:insertColumns("First Name", "Last Name", "Email") coolTable:insertEntry({"Alejandro", "Alzate", "[email protected]"}) print(coolTable)
By running our script
main.lua
with those lines$ lua main.lua
we get:
┏━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ # ┃ First Name ┃ Last Name ┃ Email ┃ ┡━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ | 1 | Alejandro | Alzate | [email protected] | └─────┴──────────────┴─────────────┴───────────────────────────────┘