summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain <romain.liautaud@snips.ai>2018-05-18 12:38:45 +0200
committerRomain <romain.liautaud@snips.ai>2018-05-18 12:45:56 +0200
commitf954041e04a033c6f845779e60efa5bd4a35029f (patch)
treef59042f9b678c46b88bd5f607180228d8d54a1da
parent34c7a91713034e683a727f3650b34d9e392f19e3 (diff)
Added the possibility to style the left and right border separately.
-rw-r--r--src/format.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/format.rs b/src/format.rs
index 25f07ea..2f4b4a0 100644
--- a/src/format.rs
+++ b/src/format.rs
@@ -176,6 +176,16 @@ impl TableFormat {
self.rborder = Some(border);
}
+ /// Set the character used for left table border
+ pub fn left_border(&mut self, border: char) {
+ self.lborder = Some(border);
+ }
+
+ /// Set the character used for right table border
+ pub fn right_border(&mut self, border: char) {
+ self.rborder = Some(border);
+ }
+
/// Set a line separator
pub fn separator(&mut self, what: LinePosition, separator: LineSeparator) {
*match what {
@@ -295,6 +305,18 @@ impl FormatBuilder {
self
}
+ /// Set the character used for left table border
+ pub fn left_border(mut self, border: char) -> Self {
+ self.format.left_border(border);
+ self
+ }
+
+ /// Set the character used for right table border
+ pub fn right_border(mut self, border: char) -> Self {
+ self.format.right_border(border);
+ self
+ }
+
/// Set a line separator format
pub fn separator(mut self, what: LinePosition, separator: LineSeparator) -> Self {
self.format.separator(what, separator);