pub struct TableCell {
pub id: Option<STString>,
pub cell_properties: Option<Box<TableCellProperties>>,
pub block_content: Vec<BlockContent>,
pub extra_attrs: HashMap<String, String>,
pub extra_children: Vec<PositionedNode>,
}Fields§
§id: Option<STString>§cell_properties: Option<Box<TableCellProperties>>§block_content: Vec<BlockContent>§extra_attrs: HashMap<String, String>Unknown attributes captured for roundtrip fidelity.
extra_children: Vec<PositionedNode>Unknown child elements captured for roundtrip fidelity.
Implementations§
Source§impl TableCell
impl TableCell
Sourcepub fn add_paragraph(&mut self) -> &mut Paragraph
pub fn add_paragraph(&mut self) -> &mut Paragraph
Add a paragraph and return a mutable reference.
Sourcepub fn set_grid_span(&mut self, n: u32)
pub fn set_grid_span(&mut self, n: u32)
Set the grid span (number of columns this cell spans).
Maps to <w:gridSpan w:val="n"/> in cell properties.
ECMA-376 Part 1, Section 17.4.17 (w:gridSpan).
Sourcepub fn set_vertical_merge(&mut self, merge_type: VMergeType)
pub fn set_vertical_merge(&mut self, merge_type: VMergeType)
Set vertical merge on this cell.
VMergeType::Restart→<w:vMerge w:val="restart"/>(starts a merged region)VMergeType::Continue→<w:vMerge/>(continues a merged region)
ECMA-376 Part 1, Section 17.4.84 (w:vMerge).
Source§impl TableCell
impl TableCell
Sourcepub fn set_background_color(&mut self, rgb: &str)
pub fn set_background_color(&mut self, rgb: &str)
Set the background (shading) color of this cell.
The rgb value should be a hex string (e.g., "FF0000" for red, "auto" for automatic).
Maps to <w:tcPr><w:shd w:val="clear" w:fill="..." w:color="auto"/></w:tcPr>.
ECMA-376 Part 1, Section 17.4.32 (w:shd).
Sourcepub fn set_borders(
&mut self,
style: BorderStyle,
width_eights: u32,
color: &str,
)
pub fn set_borders( &mut self, style: BorderStyle, width_eights: u32, color: &str, )
Set all four borders of this cell at once.
style is the border style, width_eights is the width in eighths of a point
(e.g., 4 = half a point = 0.5pt), and color is a hex color string (e.g., "000000").
ECMA-376 Part 1, Section 17.4.5 (w:tcBorders).
Sourcepub fn set_border_top(
&mut self,
style: BorderStyle,
width_eights: u32,
color: &str,
)
pub fn set_border_top( &mut self, style: BorderStyle, width_eights: u32, color: &str, )
Set the top border of this cell.
ECMA-376 Part 1, Section 17.4.5 (w:tcBorders).
Sourcepub fn set_border_bottom(
&mut self,
style: BorderStyle,
width_eights: u32,
color: &str,
)
pub fn set_border_bottom( &mut self, style: BorderStyle, width_eights: u32, color: &str, )
Set the bottom border of this cell.
ECMA-376 Part 1, Section 17.4.5 (w:tcBorders).
Sourcepub fn set_border_left(
&mut self,
style: BorderStyle,
width_eights: u32,
color: &str,
)
pub fn set_border_left( &mut self, style: BorderStyle, width_eights: u32, color: &str, )
Set the left border of this cell.
ECMA-376 Part 1, Section 17.4.5 (w:tcBorders).
Sourcepub fn set_border_right(
&mut self,
style: BorderStyle,
width_eights: u32,
color: &str,
)
pub fn set_border_right( &mut self, style: BorderStyle, width_eights: u32, color: &str, )
Set the right border of this cell.
ECMA-376 Part 1, Section 17.4.5 (w:tcBorders).
Trait Implementations§
Source§impl CellExt for TableCell
impl CellExt for TableCell
Source§fn paragraphs(&self) -> Vec<&Paragraph>
fn paragraphs(&self) -> Vec<&Paragraph>
Source§fn properties(&self) -> Option<&TableCellProperties>
fn properties(&self) -> Option<&TableCellProperties>
Source§impl<'de> Deserialize<'de> for TableCell
impl<'de> Deserialize<'de> for TableCell
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl FromXml for TableCell
impl FromXml for TableCell
Source§fn from_xml<R: BufRead>(
reader: &mut Reader<R>,
start_tag: &BytesStart<'_>,
is_empty: bool,
) -> Result<Self, ParseError>
fn from_xml<R: BufRead>( reader: &mut Reader<R>, start_tag: &BytesStart<'_>, is_empty: bool, ) -> Result<Self, ParseError>
Source§impl ToXml for TableCell
impl ToXml for TableCell
Source§fn write_attrs<'a>(&self, start: BytesStart<'a>) -> BytesStart<'a>
fn write_attrs<'a>(&self, start: BytesStart<'a>) -> BytesStart<'a>
Source§fn write_children<W: Write>(
&self,
writer: &mut Writer<W>,
) -> Result<(), SerializeError>
fn write_children<W: Write>( &self, writer: &mut Writer<W>, ) -> Result<(), SerializeError>
Source§fn is_empty_element(&self) -> bool
fn is_empty_element(&self) -> bool
Source§fn write_element<W>(
&self,
tag: &str,
writer: &mut Writer<W>,
) -> Result<(), SerializeError>where
W: Write,
fn write_element<W>(
&self,
tag: &str,
writer: &mut Writer<W>,
) -> Result<(), SerializeError>where
W: Write,
<tag attrs>children</tag> or <tag attrs/>.