Skip to content

Commit

Permalink
完善英文版的README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
blinkfox committed Jan 14, 2019
1 parent 7564af0 commit 804f73e
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 2 deletions.
71 changes: 70 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,73 @@

- 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
- Easy to integrate or customize modifications, only one `Java` file, and code specification

## How to use

### Maven

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

> **Note**: The current version is still `SNAPSHOT`, which can be used directly by the `copy` Java file.
### API

#### Demo1 (No Title)

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

Output Result:

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

#### Demo2(Titled)

```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);
```

Output Result:

```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 |
+-----------+--------+-----+--------------------+-------------+
```

## License

本 类库遵守 [Apache License 2.0][http://www.apache.org/licenses/LICENSE-2.0] 许可证.
This [mini-table](https://github.com/blinkfox/mini-table) library is open sourced under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ System.out.println(table);

## 许可证

[mini-table](https://github.com/blinkfox/mini-table) 类库遵守 [Apache License 2.0][http://www.apache.org/licenses/LICENSE-2.0] 许可证
[mini-table](https://github.com/blinkfox/mini-table) 类库遵守 [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0) 许可证

0 comments on commit 804f73e

Please sign in to comment.