Skip to content

Transformation of tables or tabluar information into a pretty printed text representation.

License

Notifications You must be signed in to change notification settings

thomashartm/TableToText

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TextToTable Formatter

The TextToTable library handles transformation of tables or tabluar information into a pretty printed text representation.

How to render a simple table

The following example renders a very simple table with header and line numbers.

SimpleTextTable simpleTextTable = new SimpleTextTable(true, true);
simpleTextTable.addRow("Column Header 1", "Column Header 2", "Column Header 1");
simpleTextTable.addRow("Row 1 Value 1", "Row 1 Value 2", "Row 1 Value 3");
simpleTextTable.addRow("Row 2 Value 1", "Row 2 Value 2", "Row 2 Value 3");
simpleTextTable.addRow("Row 2 Value 1", "Row 2 Value 2", "Row 2 Value 3");

System.out.println(simpleTextTable.printFormatted());

The rendered table looks as follows.

 Column Header 1 Column Header 2 Column Header 1 
--------------- --------------- --------------- 
1 Row 1 Value 1   Row 1 Value 2   Row 1 Value 3   
2 Row 2 Value 1   Row 2 Value 2   Row 2 Value 3   
3 Row 2 Value 1   Row 2 Value 2   Row 2 Value 3   

About

Transformation of tables or tabluar information into a pretty printed text representation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages