super_table/style/
cell.rs

1/// This can be set on [columns](crate::Column::set_cell_alignment) and [cells](crate::Cell::set_alignment).
2///
3/// Determines how content of cells should be aligned horizontally.
4///
5/// ```text
6/// +----------------------+
7/// | Header1              |
8/// +======================+
9/// | Left                 |
10/// |----------------------+
11/// |        center        |
12/// |----------------------+
13/// |                right |
14/// +----------------------+
15/// ```
16#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
17pub enum CellAlignment {
18    Left,
19    Right,
20    Center,
21}
22
23/// Determines how content of cells should be aligned vertically.
24///
25/// This is useful when cells in the same row have different heights
26/// (e.g., one cell has multi-line content while another has single-line content).
27///
28/// ```text
29/// +--------+-----+        +--------+-----+        +--------+-----+
30/// | Line 1 | Top |        | Line 1 |     |        | Line 1 |     |
31/// | Line 2 |     |        | Line 2 | Mid |        | Line 2 |     |
32/// | Line 3 |     |        | Line 3 |     |        | Line 3 | Bot |
33/// +--------+-----+        +--------+-----+        +--------+-----+
34/// ```
35#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Default)]
36pub enum VerticalAlignment {
37    /// Content is aligned to the top of the cell (default)
38    #[default]
39    Top,
40    /// Content is centered vertically in the cell
41    Middle,
42    /// Content is aligned to the bottom of the cell
43    Bottom,
44}