Description
I have implemented a new table implementation that is very easy to use. I would like to replace the current table impl with it but would like some feedback first.
The usage of the table can be seen from the ShellTableTest:
ShellTable table = new ShellTable();
table.column(new Col("id").alignRight().maxSize(5));
table.column(new Col("Name").maxSize(20));
table.column(new Col("Centered").alignCenter());
table.addRow().addContent(1, "Test", "Description");
table.addRow().addContent(20, "My name", "Description");
Row row = table.addRow();
row.addContent(123456789);
row.addContent("A very long text that should be cut");
row.addContent("A very long text that should not be cut");
table.print(System.out);
—
The output looks like this:
| id | Name | Centered | -------------------------------------------------------------------------- | 1 | Test | Description | | 20 | My name | Description | | 12345 | A very long text tha | A very long text that should not be cut |