-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
101 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
# mini-table | ||
|
||
> A lightweight, non-dependent Java ASCII TABLE generation library | ||
[![HitCount](http://hits.dwyl.io/blinkfox/mini-table.svg)](http://hits.dwyl.io/blinkfox/mini-table) [![GitHub license](https://img.shields.io/github/license/blinkfox/mini-table.svg)](https://github.com/blinkfox/mini-table/blob/master/LICENSE) ![Java Version](https://img.shields.io/badge/Java-%3E%3D%206-blue.svg) | ||
|
||
[中文文档](https://github.com/blinkfox/mini-table/blob/master/README_CN.md) | ||
|
||
> A lightweight, no dependencies Java ASCII TABLE generation library. | ||
## Features | ||
|
||
- Lightweight, no dependencies (jar package only `13kb`) | ||
- API is easy to use | ||
- Easy to integrate or customize modifications, only one `Java` file, and code specification |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# mini-table | ||
|
||
[![HitCount](http://hits.dwyl.io/blinkfox/mini-table.svg)](http://hits.dwyl.io/blinkfox/mini-table) [![GitHub license](https://img.shields.io/github/license/blinkfox/mini-table.svg)](https://github.com/blinkfox/mini-table/blob/master/LICENSE) ![Java Version](https://img.shields.io/badge/Java-%3E%3D%206-blue.svg) | ||
|
||
[English Document](https://github.com/blinkfox/mini-table/blob/master/README.md) | ||
|
||
> 一个轻量级、无任何依赖的 Java 纯文本表格(`ASCII TABLE`)生成库。 | ||
## 特性 | ||
|
||
- 轻量级、无依赖(jar包仅`13kb`) | ||
- API简单易用 | ||
- 易于集成或定制修改,仅一个[Java](https://github.com/blinkfox/mini-table/blob/master/src/main/java/com/blinkfox/minitable/MiniTable.java)文件,且代码规范 | ||
|
||
## 集成使用 | ||
|
||
### Maven集成 | ||
|
||
```xml | ||
<dependency> | ||
<groupId>com.blinkfox</groupId> | ||
<artifactId>mini-table</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
</dependency> | ||
``` | ||
|
||
> **注**:目前版本还是`SNAPSHOT`,可直接`copy` Java 文件使用。 | ||
### API 使用 | ||
|
||
#### 示例1(无标题) | ||
|
||
```java | ||
String table = new MiniTable() | ||
.addHeaders("header1", "header2") | ||
.addDatas("col11", "col12") | ||
.addDatas("col21", "col22") | ||
.render(); | ||
System.out.println(table); | ||
``` | ||
|
||
输出结果: | ||
|
||
```bash | ||
+---------+---------+ | ||
| header1 | header2 | | ||
+---------+---------+ | ||
| col11 | col12 | | ||
| col21 | col22 | | ||
+---------+---------+ | ||
``` | ||
|
||
#### 示例2(有标题) | ||
|
||
```java | ||
String table = new MiniTable("The Title") | ||
.addHeaders("Name", "Sex", "Age", "Email", "Phone") | ||
.addDatas("LiLei", "male", 25, "[email protected]", "13809345219") | ||
.addDatas("hanMeiMei", "female", 23, "[email protected]", "13515343853") | ||
.addDatas("ZhangSan", "female", 32, "[email protected]", "13920199836") | ||
.render(); | ||
System.out.println(table); | ||
``` | ||
|
||
输出结果: | ||
|
||
```bash | ||
+-------------------------------------------------------------+ | ||
| The Title | | ||
+-----------+--------+-----+--------------------+-------------+ | ||
| Name | Sex | Age | Email | Phone | | ||
+-----------+--------+-----+--------------------+-------------+ | ||
| LiLei | male | 25 | [email protected] | 13809345219 | | ||
| hanMeiMei | female | 23 | [email protected] | 13515343853 | | ||
| ZhangSan | female | 32 | [email protected] | 13920199836 | | ||
+-----------+--------+-----+--------------------+-------------+ | ||
``` | ||
|
||
## 许可证 | ||
|
||
本 [mini-table](https://github.com/blinkfox/mini-table) 类库遵守 [Apache License 2.0][http://www.apache.org/licenses/LICENSE-2.0] 许可证 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
|
||
<name>mini-table</name> | ||
<description>A lightweight, non-dependent Java ASCII TABLE generation library.</description> | ||
<url>https://github.com/blinkfox/mini-table</url> | ||
|
||
<licenses> | ||
<license> | ||
|
@@ -26,6 +27,12 @@ | |
</developer> | ||
</developers> | ||
|
||
<scm> | ||
<connection>scm:[email protected]:blinkfox/mini-table.git</connection> | ||
<developerConnection>scm:[email protected]:blinkfox/mini-table.git</developerConnection> | ||
<url>https://github.com/blinkfox/mini-table</url> | ||
</scm> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters