mirror of
https://github.com/nushell/nushell.git
synced 2025-08-15 16:43:11 +02:00
Add an option to set header on border (style) (#9920)
fix #9796 Sorry that you've had the issues. I've actually encountered them yesterday too (seems like they have appeared after some refactoring in the middle) but was not able to fix that rapid. Created a bunch of tests. cc: @fdncred Note: This option will be certainly slower then a default ones. (could be fixed but ... maybe later). Maybe it shall be cited somewhere. PS: Haven't tested on a wrapped/expanded tables. --------- Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com> Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
use nu_ansi_term::{Color, Style};
|
||||
use nu_color_config::TextStyle;
|
||||
use nu_table::{NuTable, TableConfig, TableTheme};
|
||||
use nu_table::{NuTable, NuTableConfig, TableTheme};
|
||||
use tabled::grid::records::vec_records::CellInfo;
|
||||
|
||||
fn main() {
|
||||
@ -29,8 +29,11 @@ fn main() {
|
||||
table.set_data_style(TextStyle::basic_left());
|
||||
table.set_header_style(TextStyle::basic_center().style(Style::new().on(Color::Blue)));
|
||||
|
||||
let theme = TableTheme::rounded();
|
||||
let table_cfg = TableConfig::new().theme(theme).with_header(true);
|
||||
let table_cfg = NuTableConfig {
|
||||
theme: TableTheme::rounded(),
|
||||
with_header: true,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
let output_table = table
|
||||
.draw(table_cfg, width)
|
||||
|
Reference in New Issue
Block a user