Function with_styles

Source
pub fn with_styles(s: Styles) -> TableOption
Expand description

Creates an option to set table styles during construction.

This option applies custom styling configuration to the table, controlling the appearance of headers, cells, and selection.

§Arguments

  • s - Styling configuration

§Examples

use bubbletea_widgets::table::{Model, with_styles, Styles};
use lipgloss_extras::prelude::*;

let custom_styles = Styles {
    header: Style::new().bold(true),
    cell: Style::new().padding(0, 1, 0, 1),
    selected: Style::new().background(Color::from("green")),
};

let table = Model::with_options(vec![
    with_styles(custom_styles),
]);