Skip to content

A simple Java library for easily displaying tabular data in a visually appealing ASCII table format

License

Notifications You must be signed in to change notification settings

skebir/prettytable

Repository files navigation

PrettyTable

PrettyTable is a simple single-class Java library designed to make it quick and easy to represent tabular data in visually appealing ASCII tables, like this:

+-----------+----------+---------------------+-------------+
| Firstname | Lastname |        Email        |    Phone    |
+-----------+----------+---------------------+-------------+
|   John    |   Doe    | [email protected] | +2137999999 |
|   Jane    |   Doe    | [email protected]  | +2137999999 |
+-----------+----------+---------------------+-------------+

The preceding output can be produced using the following code :

public static void main(String[] args) {
        PrettyTable table = new PrettyTable("Firstname", "Lastname", "Email", "Phone");
        table.addRow("John", "Doe", "[email protected]", "+2137999999");
        table.addRow("Jane", "Doe", "[email protected]", "+2137999999");
        System.out.println(table);
}

To use PrettyTable, you need to add the following dependencies to your project :

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

dependencies {
       compile 'com.github.skebir:prettytable:v1.0'
}

About

A simple Java library for easily displaying tabular data in a visually appealing ASCII table format

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages