pub struct Table { /* private fields */ }Expand description
An object that can contain different TableComponents in rows and columns.
Refer to table in LaTeX documentation for more information.
Example:
let mut table_1: Table = Table::new(
"H", // Positioning
"|c|c|c|", // Options
true, // Centered
Some(Text::new("Random caption")), // Caption
"tab_1" // Label
);
table_1.add_component(HorizontalLine::new());
let table_row_1 = TableRow::new(vec![Text::new(r"\multicolumn{3}{|c|}{**Lorem Ipsum**}")]);
table_1.add_component(table_row_1);
table_1.add_component(HorizontalLine::new());
let table_row_2 = TableRow::new(vec![
Text::new("#red{First}"),
Text::new("#violet{Second}"),
Text::new("#teal{Third}")]
);
table_1.add_component(table_row_2);
table_1.add_component(HorizontalLine::new());
let table_row_3 = TableRow::new(vec![
Text::new("Test 1"),
Text::new("Test 2"),
Text::new("Test 3")]
);
table_1.add_component(table_row_3);
table_1.add_component(HorizontalLine::new());Generated LaTeX:
\begin{table}[H] \label{tab_1}
\centering
\begin{tabular}{|c|c|c|}
\hline
\multicolumn{3}{|c|}{\textbf{Lorem Ipsum}} \\
\hline
{\color{red}{First}} & {\color{violet}{Second}} & {\color{teal}{Third}} \\
\hline
Test 1 & Test 2 & Test 3 \\
\hline
\end{tabular}
\caption{Random caption}
\end{table}Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Table
impl !RefUnwindSafe for Table
impl !Send for Table
impl !Sync for Table
impl Unpin for Table
impl !UnwindSafe for Table
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more