Add an option to move header on borders (#9796)

A patch to play with.
Need to make a few tests after all.

The question is what shall be done with `table.mode = none`, as it has
no borders.

```nu
$env.config.table.move_header = true
```


![image](https://github.com/nushell/nushell/assets/20165848/cdcffa6d-989c-4368-a436-fdf7d3400e31)

cc: @fdncred

---------

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
This commit is contained in:
Maxim Zhiburt
2023-08-03 22:03:20 +03:00
committed by GitHub
parent 14bf25da14
commit 7162289d77
20 changed files with 758 additions and 743 deletions

View File

@@ -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)