A List with conditional Linebreaks

Conditional line breaks can also be used for creating the impression of lists.

The following example shows a list using conditional line breaks in the left columns.

1
2
3
4
5
6
7
AsciiTable at = new AsciiTable();
at.addRule();
at.addRow("column with a list using conditional line breaks", " * list item one<br> * list item two<br> * list item three");
at.addRule();
at.setTextAlignment(TextAlignment.LEFT);
at.getRenderer().setCWC(new CWC_FixedWidth().add(20).add(25));
System.out.println(at.render(50));

The resulting output:

┌────────────────────┬─────────────────────────┐
│column with a list  │* list item one          │
│using conditional   │* list item two          │
│line breaks         │* list item three        │
└────────────────────┴─────────────────────────┘