diff options
author | Pierre-Henri Symoneaux <pierre-henri.symoneaux@nokia.com> | 2016-09-12 11:30:09 +0200 |
---|---|---|
committer | Pierre-Henri Symoneaux <pierre-henri.symoneaux@nokia.com> | 2016-09-12 11:30:09 +0200 |
commit | 3a8e694c8754c3ce2cdf842b56bee6e02fe14b71 (patch) | |
tree | 365c094077767664f3a5535134091178d8084668 /examples | |
parent | 7ea0205b9546da5b4754d79641a68605a72dd3b8 (diff) |
Fixed wrong formatting of unicode separators
Diffstat (limited to 'examples')
-rw-r--r-- | examples/formatting.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/formatting.rs b/examples/formatting.rs index 946d326..1ea0e18 100644 --- a/examples/formatting.rs +++ b/examples/formatting.rs @@ -63,4 +63,26 @@ fn main() { .build()
);
table.printstd();
+
+ // Customized format with unicode
+ // Example to print
+ // ┌─────────────┬────────────┐
+ // | Title 1 | Title 2 |
+ // ├─────────────┼────────────┤
+ // | Value 1 | Value 2 |
+ // ├─────────────┼────────────┤
+ // | Value three | Value four |
+ // └─────────────┴────────────┘
+ println!("With unicode:");
+ table.set_format(
+ format::FormatBuilder::new()
+ .column_separator('|')
+ .borders('|')
+ .separators( &[format::LinePosition::Top], format::LineSeparator::new('─', '┬', '┌', '┐'))
+ .separators( &[format::LinePosition::Intern], format::LineSeparator::new('─', '┼', '├', '┤'))
+ .separators( &[format::LinePosition::Bottom], format::LineSeparator::new('─', '┴', '└', '┘'))
+ .padding(1, 1)
+ .build()
+ );
+ table.printstd();
}
|