1//! Module contains various table configuration settings.
2//!
3//! There 2 types of settings;
4//!
5//! - [`CellOption`] which can modify only a cell.
6//! - [`TableOption`] which can modify table as a whole.
7//!
8//! [`CellOption`] works on behave of [`Modify`] which is actually a [`TableOption`].
9//!
10//! Notice that it's possble to combine settings together by the help of [`Settings`].
11//!
12#![cfg_attr(feature = "std", doc = "```")]
13#![cfg_attr(not(feature = "std"), doc = "```ignore")]
14//! use tabled::{Table, settings::{Settings, Style, Padding}};
15//!
16//! let table_config = Settings::default()
17//! .with(Padding::new(2, 2, 1, 1))
18//! .with(Style::rounded());
19//!
20//! let data = [[2023;9]; 3];
21//!
22//! let table = Table::new(data).with(table_config).to_string();
23//!
24//! assert_eq!(
25//! table,
26//! "╭────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────╮\n\
27//! │ │ │ │ │ │ │ │ │ │\n\
28//! │ 0 │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │\n\
29//! │ │ │ │ │ │ │ │ │ │\n\
30//! ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤\n\
31//! │ │ │ │ │ │ │ │ │ │\n\
32//! │ 2023 │ 2023 │ 2023 │ 2023 │ 2023 │ 2023 │ 2023 │ 2023 │ 2023 │\n\
33//! │ │ │ │ │ │ │ │ │ │\n\
34//! │ │ │ │ │ │ │ │ │ │\n\
35//! │ 2023 │ 2023 │ 2023 │ 2023 │ 2023 │ 2023 │ 2023 │ 2023 │ 2023 │\n\
36//! │ │ │ │ │ │ │ │ │ │\n\
37//! │ │ │ │ │ │ │ │ │ │\n\
38//! │ 2023 │ 2023 │ 2023 │ 2023 │ 2023 │ 2023 │ 2023 │ 2023 │ 2023 │\n\
39//! │ │ │ │ │ │ │ │ │ │\n\
40//! ╰────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────╯"
41//! )
42//! ```
43
44mod cell_option;
45mod settings_list;
46mod table_option;
47
48#[cfg(feature = "std")]
49#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
50pub mod object;
51
52#[cfg(feature = "std")]
53mod modify;
54
55mod alignment;
56mod extract;
57mod margin;
58mod padding;
59mod rotate;
60
61#[cfg(feature = "std")]
62mod color;
63#[cfg(feature = "std")]
64mod concat;
65#[cfg(feature = "std")]
66mod duplicate;
67
68pub mod style;
69
70#[cfg(feature = "std")]
71#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
72pub mod disable;
73#[cfg(feature = "std")]
74#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
75pub mod format;
76#[cfg(feature = "std")]
77#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
78pub mod formatting;
79#[cfg(feature = "std")]
80#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
81pub mod height;
82#[cfg(feature = "std")]
83#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
84pub mod highlight;
85#[cfg(feature = "std")]
86#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
87pub mod locator;
88#[cfg(feature = "std")]
89#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
90pub mod measurement;
91#[cfg(feature = "std")]
92#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
93pub mod merge;
94#[cfg(feature = "std")]
95#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
96pub mod panel;
97#[cfg(feature = "std")]
98#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
99pub mod peaker;
100#[cfg(feature = "std")]
101#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
102mod shadow;
103#[cfg(feature = "std")]
104#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
105pub mod span;
106#[cfg(feature = "std")]
107#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
108pub mod split;
109#[cfg(feature = "std")]
110#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
111pub mod themes;
112#[cfg(feature = "std")]
113#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
114pub mod width;
115
116pub use cell_option::CellOption;
117pub use settings_list::{EmptySettings, Settings};
118pub use table_option::TableOption;
119
120#[cfg(feature = "std")]
121#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
122pub use modify::{Modify, ModifyList};
123
124pub use self::{
125 alignment::Alignment, extract::Extract, margin::Margin, padding::Padding, rotate::Rotate,
126 style::Style,
127};
128
129#[cfg(feature = "std")]
130#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
131pub use self::{
132 color::Color, concat::Concat, disable::Disable, duplicate::Dup, format::Format, height::Height,
133 highlight::Highlight, merge::Merge, panel::Panel, shadow::Shadow, span::Span, style::Border,
134 width::Width,
135};
136