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
sourceimpl 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