pub struct CT_Table {
pub properties: Option<CT_TableProperties>,
pub grid: CT_TableGrid,
pub rows: Vec<CT_TableRow>,
/* private fields */
}Expand description
One DrawingML a:tbl with typed grid, rows, cells, and banding properties.
Fields§
§properties: Option<CT_TableProperties>§grid: CT_TableGrid§rows: Vec<CT_TableRow>Implementations§
Source§impl CT_Table
impl CT_Table
Sourcepub fn new(rows: usize, columns: usize, width: Emu, height: Emu) -> Result<Self>
pub fn new(rows: usize, columns: usize, width: Emu, height: Emu) -> Result<Self>
Creates a rectangular table using truncating quotients and assigns each remainder to the final column or row.
Sourcepub fn from_xml_with_inherited_namespaces(
xml: &[u8],
inherited_namespaces: &[(String, String)],
) -> Result<Self>
pub fn from_xml_with_inherited_namespaces( xml: &[u8], inherited_namespaces: &[(String, String)], ) -> Result<Self>
Parses an extracted table and retains namespace bindings inherited from its original ancestors so the standalone writer remains namespace complete.
Sourcepub fn to_xml(&self) -> Result<Vec<u8>>
pub fn to_xml(&self) -> Result<Vec<u8>>
Serialises a self-contained table with fixed a: prefixes.
Sourcepub fn set_column_width(&mut self, index: usize, width: Emu) -> Result<()>
pub fn set_column_width(&mut self, index: usize, width: Emu) -> Result<()>
Changes one grid-column width and keeps the column’s preserved
a:gridCol content with it, even when other columns share the old or
the new width.
Sourcepub fn insert_row(&mut self, index: usize) -> Result<()>
pub fn insert_row(&mut self, index: usize) -> Result<()>
Inserts a row before the row at index, or appends one when index
equals the row count.
The new row copies the height of the row above it, or of the first row when it becomes the first. Each new cell copies the cell properties of that row’s cell in the same column and the formatting of its first paragraph without the text. A row inserted inside a merged cell extends the merge, and every other new cell is unmerged.
Sourcepub fn remove_row(&mut self, index: usize) -> Result<()>
pub fn remove_row(&mut self, index: usize) -> Result<()>
Removes the row at index, which must not be the only row.
A merged cell across the row loses one row of its span. When the row holds the top of such a merge, the row below takes over the origin, with the origin’s text and cell properties.
Sourcepub fn insert_column(&mut self, index: usize) -> Result<()>
pub fn insert_column(&mut self, index: usize) -> Result<()>
Inserts a grid column before the column at index, or appends one
when index equals the column count.
The new column copies the width of the column left of it, or of the
first column when it becomes the first, and each new cell copies that
column’s cell in the same row as insert_row does. A column inserted
inside a merged cell extends the merge, and every other new cell is
unmerged.
Sourcepub fn remove_column(&mut self, index: usize) -> Result<()>
pub fn remove_column(&mut self, index: usize) -> Result<()>
Removes the grid column at index, which must not be the only one.
A merged cell across the column loses one column of its span. When the column holds the left edge of such a merge, the column to its right takes over the origin, with the origin’s text and cell properties.
Sourcepub fn validate_grid_and_merges(&self) -> Result<()>
pub fn validate_grid_and_merges(&self) -> Result<()>
Returns every merged rectangle by its origin, after checking that each row has one explicit cell per grid column and that every merge fits the grid. Checks the explicit grid and every modeled merge continuation.