Skip to content

A lightweight, zero-dependency Java ASCII TABLE generation library. 一个轻量级、零依赖的 Java ASCII 表格生成库

License

Notifications You must be signed in to change notification settings

blinkfox/mini-table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mini-table

HitCount Build Status Javadocs GitHub license codecov Maven Central Java Version

中文文档

A lightweight, zero-dependency Java ASCII TABLE generation library.

Features

  • Lightweight, no dependencies (jar package only 9kb)
  • API is easy to use
  • Easy to integrate or customize modifications, only one Java file, and code specification

How to use

Maven

<dependency>
    <groupId>com.blinkfox</groupId>
    <artifactId>mini-table</artifactId>
    <version>1.0.0</version>
</dependency>

API

Demo1 (No Title)

String table = new MiniTable()
        .addHeaders("header1", "header2")
        .addDatas("col11", "col12")
        .addDatas("col21", "col22")
        .render();
System.out.println(table);

Output Result:

+---------+---------+
| header1 | header2 |
+---------+---------+
|  col11  |  col12  |
|  col21  |  col22  |
+---------+---------+

Demo2(Titled)

String table = new MiniTable("The Title")
        .addHeaders("Name", "Sex", "Age", "Email", "Phone")
        .addDatas("LiLei", "male", 25, "lilei@gmail.com", "13809345219")
        .addDatas("hanMeiMei", "female", 23, "hmm@163.com", "13515343853")
        .addDatas("ZhangSan", "female", 32, "zhangsan@gmail.com", "13920199836")
        .render();
System.out.println(table);

Output Result:

+-------------------------------------------------------------+
|                          The Title                          |
+-----------+--------+-----+--------------------+-------------+
|   Name    |  Sex   | Age |       Email        |    Phone    |
+-----------+--------+-----+--------------------+-------------+
|   LiLei   |  male  | 25  |  lilei@gmail.com   | 13809345219 |
| hanMeiMei | female | 23  |    hmm@163.com     | 13515343853 |
| ZhangSan  | female | 32  | zhangsan@gmail.com | 13920199836 |
+-----------+--------+-----+--------------------+-------------+

License

This mini-table library is open sourced under the Apache License 2.0.

About

A lightweight, zero-dependency Java ASCII TABLE generation library. 一个轻量级、零依赖的 Java ASCII 表格生成库

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages