Skip to content
vlang Term Table
V
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
table.v

README.md

Vlang Term Table

How to install

use vpm

v install tianyazc.vttable

use vpkg

vpkg get github.com/tianyazc/vttable

How to use

module main

import tianyazc.vttable 
fn main() {
    tdata := [
       ["name","source","sex","age"],
       ["Meter","80","man",""],
       ["Peter","92","man","21"],
       ["xiaoming","86","woman","18"]
   ]
    t := vttable.Table{
                    data:tdata,
                    position:"right",
                    // style: "simplicity"
                    }
    t.tables()
}
//out
$ v run table_t.v
+---------+-------+------+----+
|     name| source|   sex| age|
+---------+-------+------+----+
|    Meter|     80|   man|    |
+---------+-------+------+----+
|    Peter|     92|   man|  21|
+---------+-------+------+----+
| xiaoming|     86| woman|  18|
+---------+-------+------+----+

module main

import tianyazc.vttable
fn main() {
    tdata := [
       ["name","source","sex","age"],
       ["Meter","80","man",""],
       ["Peter","92","man","21"],
       ["xiaoming","86","woman","18"]
   ]
    t := vttable.Table{
                    data:tdata,
                    // position:"right",
                    style: "simplicity"
                    }
    t.tables()
}
//out
$ v run table_t.v
+---------+-------+------+----+
|name     |source |sex   |age |
+---------+-------+------+----+
|Meter    |80     |man   |    |
|Peter    |92     |man   |21  |
|xiaoming |86     |woman |18  |
+---------+-------+------+----+
You can’t perform that action at this time.