Git Product home page Git Product logo

gfxtables.lua's Introduction

gfxTables.lua

Have you ever been jealous of how pretty SQL consoles prints? Here gfxTables to help you!

To do:

  • lua table to gfxTable and vice versa

Features

  • Simple API
  • Easy to work with

Getting started

  1. ๐Ÿ“ก Get a copy of srt.lua from the Official Repository or From Luarocks

  2. ๐Ÿ’พ Copy gfxTables.lua where you like to use it, or just on the root directory of the project

  3. โš™ Add it to your project like this:

    local gfxTables = require("path/to/gfx/Tables")
  4. ๐Ÿ“ƒ Create a new table object:

    local coolTable = gfxTables.newTable()
  5. ๐ŸŽฎ 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)
  6. ๐Ÿ’Ž 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]  |
    โ””โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    

gfxtables.lua's People

Contributors

alejandro-alzate avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.