Closed hackers267 closed 2 days ago
fix the error when build the xml, the width_type is fixed, not pick from the TableWith
Change the fixed WidthType::Dxa to the self.width_type, so let the defined width is useful
WidthType::Dxa
self.width_type
Use the code to genrerate a docx:
use docx_rs::*; pub fn main() -> Result<(), DocxError> { let path = std::path::Path::new("./table.docx"); let file = std::fs::File::create(path).unwrap(); let table = Table::new(vec![TableRow::new(vec![ TableCell::new().add_paragraph(Paragraph::new()) ])]).width(5000, WidthType::Pct); Docx::new().add_table(table).build().pack(file)?; Ok(()) }
then to unzip the table.docx, and check the tblW property's type is pct.
tblW
pct
What's the reason that can't be merged?
sorry, i'm busy.i'll check.
LGTM thanks for your contribution
fix the error when build the xml, the width_type is fixed, not pick from the TableWith
What does this change?
Change the fixed
WidthType::Dxa
to theself.width_type
, so let the defined width is usefulReferences
Screenshots
What can I check for bug fixes?
Use the code to genrerate a docx:
then to unzip the table.docx, and check the
tblW
property's type ispct
.