diff options
author | Pierre-Henri Symoneaux <pierre.henri.symoneaux@gmail.com> | 2018-09-23 10:24:04 +0200 |
---|---|---|
committer | Pierre-Henri Symoneaux <pierre.henri.symoneaux@gmail.com> | 2018-09-23 10:24:04 +0200 |
commit | 61766c924b49bddce2266e9ede5cde42e9c7491e (patch) | |
tree | f87e90e1080bebaea60fc52d9d2a1a63cb8fd76b /src/format.rs | |
parent | 029141636d41f850e0ecf9e63992cf97e64d86ed (diff) |
Added FORMAT_BOX_CHARS
Diffstat (limited to 'src/format.rs')
-rw-r--r-- | src/format.rs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/format.rs b/src/format.rs index 45405ca..4dec4fa 100644 --- a/src/format.rs +++ b/src/format.rs @@ -530,5 +530,38 @@ pub mod consts { .separator(LinePosition::Title, *MINUS_PLUS_SEP) .column_separator('|') .build(); + + /// A table with borders and delimiters made with box characters + /// + /// # Example + /// ```text + /// ┌────┬────┬────┐ + /// │ t1 │ t2 │ t3 │ + /// ├────┼────┼────┤ + /// │ 1 │ 1 │ 1 │ + /// ├────┼────┼────┤ + /// │ 2 │ 2 │ 2 │ + /// └────┴────┴────┘ + /// ``` + pub static ref FORMAT_BOX_CHARS: TableFormat = FormatBuilder::new() + .column_separator('│') + .borders('│') + .separators(&[LinePosition::Top], + LineSeparator::new('─', + '┬', + '┌', + '┐')) + .separators(&[LinePosition::Intern], + LineSeparator::new('─', + '┼', + '├', + '┤')) + .separators(&[LinePosition::Bottom], + LineSeparator::new('─', + '┴', + '└', + '┘')) + .padding(1, 1) + .build(); } } |