From f954041e04a033c6f845779e60efa5bd4a35029f Mon Sep 17 00:00:00 2001 From: Romain Date: Fri, 18 May 2018 12:38:45 +0200 Subject: Added the possibility to style the left and right border separately. --- src/format.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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); -- cgit v1.2.3