[−][src]Struct comfy_table::Cell
A stylable table cell with content.
Methods
impl Cell
[src]
pub fn new<T: ToString>(content: T) -> Self
[src]
Create a new Cell
pub fn get_content(&self) -> String
[src]
Return a copy of the content contained in this cell.
pub fn set_alignment(self, alignment: CellAlignment) -> Self
[src]
Set the alignment of content for this cell.
Setting this overwrites alignment settings of the Column for this specific Cell.
use comfy_table::CellAlignment; use comfy_table::Cell; let mut cell = Cell::new("Some content") .set_alignment(CellAlignment::Center);
pub fn fg(self, color: Color) -> Self
[src]
Set the foreground text color for this cell. comfy-table uses Crossterm Colors. Look at their documentation for all possible Colors.
use comfy_table::Color; use comfy_table::Cell; let mut cell = Cell::new("Some content") .fg(Color::Red);
pub fn bg(self, color: Color) -> Self
[src]
Set the background color for this cell. comfy-table uses Crossterm Colors. Look at their documentation for all possible Colors.
use comfy_table::Color; use comfy_table::Cell; let mut cell = Cell::new("Some content") .bg(Color::Red);
pub fn add_attribute(self, attribute: Attribute) -> Self
[src]
Add a styling attribute to the content cell Those can be bold, italic, blinking and many more. comfy-table uses Crossterm Attributes. Look at their documentation for all possible Attributes.
use comfy_table::Attribute; use comfy_table::Cell; let mut cell = Cell::new("Some content") .add_attribute(Attribute::Bold);
pub fn add_attributes(self, attribute: Vec<Attribute>) -> Self
[src]
Same as add_attribute, but you can pass a Vector of Attributes
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Cell
impl Send for Cell
impl Sync for Cell
impl Unpin for Cell
impl UnwindSafe for Cell
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,