mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 07:35:42 +02:00
nu_table: Fix style of tables with no header (#6025)
Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
This commit is contained in:
@ -168,7 +168,7 @@ impl Command for Table {
|
||||
}
|
||||
|
||||
let table = nu_table::Table {
|
||||
headers: vec![],
|
||||
headers: None,
|
||||
data: output,
|
||||
theme: load_theme_from_config(config),
|
||||
};
|
||||
@ -430,16 +430,18 @@ fn convert_to_table(
|
||||
}
|
||||
|
||||
Ok(Some(nu_table::Table {
|
||||
headers: headers
|
||||
.into_iter()
|
||||
.map(|x| StyledString {
|
||||
contents: x,
|
||||
style: TextStyle {
|
||||
alignment: nu_table::Alignment::Center,
|
||||
color_style: Some(color_hm["header"]),
|
||||
},
|
||||
})
|
||||
.collect(),
|
||||
headers: Some(
|
||||
headers
|
||||
.into_iter()
|
||||
.map(|x| StyledString {
|
||||
contents: x,
|
||||
style: TextStyle {
|
||||
alignment: nu_table::Alignment::Center,
|
||||
color_style: Some(color_hm["header"]),
|
||||
},
|
||||
})
|
||||
.collect(),
|
||||
),
|
||||
data: data
|
||||
.into_iter()
|
||||
.map(|x| {
|
||||
|
Reference in New Issue
Block a user