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
48mod alignment;
49mod extract;
50mod margin;
51mod padding;
52mod reverse;
53mod rotate;
54
55#[cfg(feature = "std")]
56mod modify;
57
58#[cfg(feature = "std")]
59mod color;
60#[cfg(feature = "std")]
61mod concat;
62#[cfg(feature = "std")]
63mod duplicate;
64
65pub mod style;
66
67#[cfg(feature = "std")]
68#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
69pub mod object;
70
71#[cfg(feature = "std")]
72#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
73pub mod disable;
74#[cfg(feature = "std")]
75#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
76pub mod format;
77#[cfg(feature = "std")]
78#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
79pub mod formatting;
80#[cfg(feature = "std")]
81#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
82pub mod height;
83#[cfg(feature = "std")]
84#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
85pub mod highlight;
86#[cfg(feature = "std")]
87#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
88pub mod location;
89#[cfg(feature = "std")]
90#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
91pub mod measurement;
92#[cfg(feature = "std")]
93#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
94pub mod merge;
95#[cfg(feature = "std")]
96#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
97pub mod panel;
98#[cfg(feature = "std")]
99#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
100pub mod peaker;
101#[cfg(feature = "std")]
102#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
103mod shadow;
104#[cfg(feature = "std")]
105#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
106pub mod span;
107#[cfg(feature = "std")]
108#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
109pub mod split;
110#[cfg(feature = "std")]
111#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
112pub mod themes;
113#[cfg(feature = "std")]
114#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
115pub mod width;
116
117pub use cell_option::CellOption;
118pub use settings_list::{EmptySettings, Settings};
119pub use table_option::TableOption;
120
121pub use self::{
122 alignment::Alignment, extract::Extract, margin::Margin, padding::Padding, reverse::Reverse,
123 rotate::Rotate, style::Border, style::Style,
124};
125
126#[cfg(feature = "std")]
127#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
128pub use self::{
129 color::Color,
130 concat::Concat,
131 disable::Disable,
132 duplicate::Dup,
133 format::Format,
134 height::Height,
135 highlight::Highlight,
136 merge::Merge,
137 modify::{Modify, ModifyList},
138 panel::Panel,
139 shadow::Shadow,
140 span::Span,
141 themes::Theme,
142 width::Width,
143};
144