Border Styles

All available table border styles in Crest, from ASCII and Unicode to CSV and markup formats.

Crest provides 15 border styles through the Border enum. The default is asciiCompact.

Available Styles

Enum ValueDescription
asciiCompactCompact ASCII borders (default)
asciiDotsDotted ASCII borders
asciiSeparatedASCII with row separators
githubMarkdownGitHub-flavored Markdown table
mysqlStyleMySQL client output style
unicodeDoubleDouble-line Unicode box drawing
unicodeSingleSingle-line Unicode box drawing
unicodeSingleSeparatedSingle-line Unicode with row separators
whitespaceCompactCompact whitespace-only alignment
whitespaceSeparatedWhitespace with blank line separators
tsvTab-separated values
csvComma-separated values
reStructuredTextGridreStructuredText grid table
reStructuredTextSimplereStructuredText simple table
redditMarkdownReddit-flavored Markdown table

Example Output

Given a table with columns name, version, and status, here is how several popular styles render.

asciiCompact (default)

 name       version   status
---------- --------- --------
 tomcat     9.0.1     active
 jetty      11.0.2    active
 netty      4.1.85    sunset

asciiSeparated

 name       version   status
---------- --------- --------
 tomcat     9.0.1     active
---------- --------- --------
 jetty      11.0.2    active
---------- --------- --------
 netty      4.1.85    sunset
---------- --------- --------

githubMarkdown

| name   | version | status |
|--------|---------|--------|
| tomcat | 9.0.1   | active |
| jetty  | 11.0.2  | active |
| netty  | 4.1.85  | sunset |

mysqlStyle

+--------+---------+--------+
| name   | version | status |
+--------+---------+--------+
| tomcat | 9.0.1   | active |
| jetty  | 11.0.2  | active |
| netty  | 4.1.85  | sunset |
+--------+---------+--------+

unicodeSingle

┌────────┬─────────┬────────┐
│ name   │ version │ status │
├────────┼─────────┼────────┤
│ tomcat │ 9.0.1   │ active │
│ jetty  │ 11.0.2  │ active │
│ netty  │ 4.1.85  │ sunset │
└────────┴─────────┴────────┘

unicodeDouble

╔════════╦═════════╦════════╗
║ name   ║ version ║ status ║
╠════════╬═════════╬════════╣
║ tomcat ║ 9.0.1   ║ active ║
║ jetty  ║ 11.0.2  ║ active ║
║ netty  ║ 4.1.85  ║ sunset ║
╚════════╩═════════╩════════╝

Usage

Set the border in the @Table annotation:

@Command
@Table(fields = "name version status", border = Border.githubMarkdown)
public List<Package> list() {
    return packageService.findAll();
}

Or override at runtime with the --table-border flag:

myapp list --table-border=unicodeSingle

For data interchange, tsv and csv produce plain delimited output suitable for piping into other tools:

myapp list --table-border=csv > packages.csv