pub enum Alignment {
Horizontal(AlignmentHorizontal),
Vertical(AlignmentVertical),
}
Expand description
Alignment represent a horizontal and vertical alignment setting for any cell on a Table
.
let mut table = Table::new(&data);
table.with(Modify::new(Rows::single(0)).with(Alignment::center()));
Variants§
Horizontal(AlignmentHorizontal)
A horizontal alignment.
Vertical(AlignmentVertical)
A vertical alignment.
Implementations§
Source§impl Alignment
impl Alignment
Sourcepub fn left() -> Self
pub fn left() -> Self
Left constructs a horizontal alignment to AlignmentHorizontal::Left
Sourcepub fn right() -> Self
pub fn right() -> Self
Right constructs a horizontal alignment to AlignmentHorizontal::Right
§Notice
When you use MinWidth
the alignment might not work as you expected.
You could try to apply TrimStrategy
which may help.
Sourcepub fn center() -> Self
pub fn center() -> Self
Center constructs a horizontal alignment to AlignmentHorizontal::Center
§Notice
When you use MinWidth
the alignment might not work as you expected.
You could try to apply TrimStrategy
which may help.
Sourcepub fn top() -> Self
pub fn top() -> Self
Top constructs a vertical alignment to AlignmentVertical::Top
Sourcepub fn bottom() -> Self
pub fn bottom() -> Self
Bottom constructs a vertical alignment to AlignmentVertical::Bottom
Sourcepub fn center_vertical() -> Self
pub fn center_vertical() -> Self
Center_vertical
constructs a vertical alignment to AlignmentVertical::Center