diff --git a/crates/nu-command/src/viewers/table.rs b/crates/nu-command/src/viewers/table.rs
index e128ba637d..54c6f20a8d 100644
--- a/crates/nu-command/src/viewers/table.rs
+++ b/crates/nu-command/src/viewers/table.rs
@@ -18,8 +18,8 @@ use nu_protocol::{
ByteStream, Config, DataSource, ListStream, PipelineMetadata, Signals, TableMode, ValueIterator,
};
use nu_table::{
- common::create_nu_table_config, CollapsedTable, ExpandedTable, JustTable, NuRecordsValue,
- NuTable, StringResult, TableOpts, TableOutput,
+ common::configure_table, CollapsedTable, ExpandedTable, JustTable, NuRecordsValue, NuTable,
+ StringResult, TableOpts, TableOutput,
};
use nu_utils::{get_ls_colors, terminal_size};
@@ -1070,13 +1070,13 @@ fn create_empty_placeholder(
let data = vec![vec![cell]];
let mut table = NuTable::from(data);
table.set_data_style(TextStyle::default().dimmed());
- let out = TableOutput::from_table(table, false, false);
+ let mut out = TableOutput::from_table(table, false, false);
let style_computer = &StyleComputer::from_config(engine_state, stack);
- let config = create_nu_table_config(&config, style_computer, &out, false, TableMode::default());
+ configure_table(&mut out, &config, style_computer, TableMode::default());
out.table
- .draw(config, termwidth)
+ .draw(termwidth)
.expect("Could not create empty table placeholder")
}
diff --git a/crates/nu-table/examples/table_demo.rs b/crates/nu-table/examples/table_demo.rs
index 402936e8c0..581d8934ea 100644
--- a/crates/nu-table/examples/table_demo.rs
+++ b/crates/nu-table/examples/table_demo.rs
@@ -1,6 +1,6 @@
use nu_ansi_term::{Color, Style};
use nu_color_config::TextStyle;
-use nu_table::{NuTable, NuTableConfig, TableTheme};
+use nu_table::{NuTable, TableTheme};
use tabled::grid::records::vec_records::Text;
fn main() {
@@ -28,15 +28,11 @@ fn main() {
table.set_data_style(TextStyle::basic_left());
table.set_header_style(TextStyle::basic_center().style(Style::new().on(Color::Blue)));
-
- let table_cfg = NuTableConfig {
- theme: TableTheme::rounded(),
- with_header: true,
- ..Default::default()
- };
+ table.set_theme(TableTheme::rounded());
+ table.set_structure(false, true, false);
let output_table = table
- .draw(table_cfg, width)
+ .draw(width)
.unwrap_or_else(|| format!("Couldn't fit table into {width} columns!"));
println!("{output_table}")
diff --git a/crates/nu-table/src/common.rs b/crates/nu-table/src/common.rs
index e5733b98ba..8c89fbbfe2 100644
--- a/crates/nu-table/src/common.rs
+++ b/crates/nu-table/src/common.rs
@@ -3,9 +3,7 @@ use nu_protocol::{Config, FooterMode, ShellError, Span, TableMode, TrimStrategy,
use terminal_size::{terminal_size, Height, Width};
-use crate::{
- clean_charset, colorize_space_str, string_wrap, NuTableConfig, TableOutput, TableTheme,
-};
+use crate::{clean_charset, colorize_space_str, string_wrap, TableOutput, TableTheme};
pub type NuText = (String, TextStyle);
pub type TableResult = Result