pub struct MaxWidth;Expand description
MaxWidth allows you to set a max width of an object on a Grid, using different strategies. It also allows you to set a MaxWidth for a whole table.
It is an abstract factory.
Beware that borders are not removed when you set a size value to very small. For example if you set size to 0 the table still be rendered but with all content removed.
Also be aware that it doesn’t changes crate::Padding settings.
The function is color aware if a color feature is on.
Examples
Cell change
use tabled::{object::Full, MaxWidth, Modify, Style, Table};
let data = ["Hello", "World", "!"];
let table = Table::new(&data)
.with(Style::github_markdown())
.with(Modify::new(Full).with(MaxWidth::truncating(3).suffix("...")));Table change
use tabled::{MaxWidth, Table};
let table = Table::new(&["Hello World!"]).with(MaxWidth::wrapping(5));Implementations
Auto Trait Implementations
impl RefUnwindSafe for MaxWidth
impl Send for MaxWidth
impl Sync for MaxWidth
impl Unpin for MaxWidth
impl UnwindSafe for MaxWidth
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more