use docx::{
document::{Paragraph, Table, TableCell, TableGrid, TableRow},
formatting::{TableCellProperty, TableProperty, TableRowProperty},
Docx, DocxResult,
};
fn main() -> DocxResult<()> {
let mut docx = Docx::default();
let tbl = Table::default()
.property(TableProperty::default())
.push_grid(vec![1, 2, 3])
.push_grid(TableGrid::default())
.push_row(
TableRow::default()
.property(TableRowProperty::default())
.push_cell(Paragraph::default())
.push_cell(
TableCell::pargraph(Paragraph::default())
.property(TableCellProperty::default()),
),
);
docx.document.push(tbl);
docx.write_file("table.docx")?;
Ok(())
}