docx-rs
docx-rs copied to clipboard
Table not working?
Describe the bug
Hi all, I think this is more a problem of mine rather than a real bug. Anyhow, I am not able to get table working. I also tried to simply copy the example code (table.rs) from github but still no results.
Script used (table.rs)
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())
])]);
Docx::new().add_table(table).build().pack(file)?;
Ok(())
}
Expected behavior
Generated table.docx file contains a table.
Actual behavior
Generated table.docx file is completely empty.
Screenshots
Desktop
- OS: Windows 11
- Version: docx-rs = "0.4.17"