rs_docx/formatting/
table_cell_property.rs1use 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 #[xml(child = "w:gridSpan")]
14 pub grid_span: Option<super::GridSpan>,
15 #[xml(child = "w:vMerge")]
16 pub v_merge: Option<super::VMerge>,
17}
18
19impl TableCellProperty {
20 __setter!(v_align: super::VAlign);
21 __setter!(wide: Option<super::TableCellWidth>);
22 __setter!(grid_span: Option<super::GridSpan>);
23 __setter!(v_merge: Option<super::VMerge>);
24}
25
26__xml_test_suites!(
27 TableCellProperty,
28 TableCellProperty::default(),
29 r#"<w:tcPr><w:vAlign w:val="top"/></w:tcPr>"#,
30 TableCellProperty::default().v_align(super::VAlignType::Bottom),
31 r#"<w:tcPr><w:vAlign w:val="bottom"/></w:tcPr>"#,
32);