summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd2/table_creator.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/cmd2/table_creator.py b/cmd2/table_creator.py
index 8422fa7d..b35cade6 100644
--- a/cmd2/table_creator.py
+++ b/cmd2/table_creator.py
@@ -548,11 +548,13 @@ class SimpleTable(TableCreator):
total_width = self.total_width()
divider_char_width = ansi.style_aware_wcswidth(self.divider_char)
- # Add padding if divider char does not divide evenly into table width
- divider = (self.divider_char * (total_width // divider_char_width)) + (SPACE * (total_width % divider_char_width))
+ # Make divider as wide as table and use padding if width of
+ # divider_char does not divide evenly into table width.
+ divider = self.divider_char * (total_width // divider_char_width)
+ divider += SPACE * (total_width % divider_char_width)
+
header_buf.write('\n')
header_buf.write(divider)
-
return header_buf.getvalue()
def generate_data_row(self, row_data: Sequence[Any]) -> str: