docx_rust/formatting/
table_cell_property.rs

1use hard_xml::{XmlRead, XmlWrite};
2
3use crate::{__setter, __xml_test_suites};
4
5#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
6#[cfg_attr(test, derive(PartialEq))]
7#[xml(tag = "w:tcPr")]
8pub struct TableCellProperty {
9    #[xml(child = "w:tcW")]
10    pub wide: Option<super::TableCellWidth>,
11    #[xml(default, child = "w:vAlign")]
12    pub v_align: super::VAlign,
13}
14
15impl TableCellProperty {
16    __setter!(v_align: super::VAlign);
17    __setter!(wide: Option<super::TableCellWidth>);
18}
19
20__xml_test_suites!(
21    TableCellProperty,
22    TableCellProperty::default(),
23    r#"<w:tcPr><w:vAlign w:val="top"/></w:tcPr>"#,
24    TableCellProperty::default().v_align(super::VAlignType::Bottom),
25    r#"<w:tcPr><w:vAlign w:val="bottom"/></w:tcPr>"#,
26);