From a5083b902869b20216bd1851c54147e04145e745 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 28 Feb 2020 09:45:31 +0100 Subject: [PATCH] text_table.rs: add table padding --- proxmox/src/api/cli/text_table.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/proxmox/src/api/cli/text_table.rs b/proxmox/src/api/cli/text_table.rs index ce51a8ce..14db9bc7 100644 --- a/proxmox/src/api/cli/text_table.rs +++ b/proxmox/src/api/cli/text_table.rs @@ -130,7 +130,7 @@ impl TableBorders { } } - for _j in 0..*column_width { + for _j in 0..*column_width+2 { if ascii_delimiters { top.push('='); head.push('='); @@ -504,11 +504,13 @@ fn render_table( for (i, name) in column_names.iter().enumerate() { let column = &tabledata[i]; header.push(borders.column_separator); + header.push(' '); if column.right_align { header.push_str(&format!("{:>width$}", name, width = column.width)); } else { header.push_str(&format!("{:( if i > 0 { text.push(' '); } } else { text.push(borders.column_separator); + text.push(' '); } if column.right_align { @@ -545,6 +548,8 @@ fn render_table( } else { text.push_str(&format!("{: