Method AppendTable
AppendTable(WordDocument, int, int, Twips)
Appends a table to the document's last section, creating a section when the document has none.
public static Table AppendTable(this WordDocument document, int rowCount, int columnCount, Twips columnWidth)
Parameters
documentWordDocumentThe document.
rowCountintThe number of rows.
columnCountintThe number of columns.
columnWidthTwipsThe width of every grid column. The table grid is required by the schema, so the width is a parameter rather than an invented default.
Returns
- Table
The appended table.
Exceptions
- ArgumentNullException
documentis null.- ArgumentOutOfRangeException
rowCountorcolumnCountis negative.
AppendTable(Section, int, int, Twips)
Appends a table to a section.
public static Table AppendTable(this Section section, int rowCount, int columnCount, Twips columnWidth)
Parameters
sectionSectionThe section.
rowCountintThe number of rows.
columnCountintThe number of columns.
columnWidthTwipsThe width of every grid column.
Returns
- Table
The appended table.
Exceptions
- ArgumentNullException
sectionis null.- ArgumentOutOfRangeException
rowCountorcolumnCountis negative.
AppendTable(TableCell, int, int, Twips)
Appends a nested table to a table cell.
public static Table AppendTable(this TableCell cell, int rowCount, int columnCount, Twips columnWidth)
Parameters
cellTableCellThe cell.
rowCountintThe number of rows.
columnCountintThe number of columns.
columnWidthTwipsThe width of every grid column.
Returns
- Table
The appended table.
Exceptions
- ArgumentNullException
cellis null.- ArgumentOutOfRangeException
rowCountorcolumnCountis negative.
AppendTable(HeaderFooter, int, int, Twips)
Appends a table to a header or footer.
public static Table AppendTable(this HeaderFooter part, int rowCount, int columnCount, Twips columnWidth)
Parameters
partHeaderFooterThe header or footer.
rowCountintThe number of rows.
columnCountintThe number of columns.
columnWidthTwipsThe width of every grid column.
Returns
- Table
The appended table.
Exceptions
- ArgumentNullException
partis null.- ArgumentOutOfRangeException
rowCountorcolumnCountis negative.
AppendTable(Note, int, int, Twips)
Appends a table to a footnote or endnote body.
public static Table AppendTable(this Note note, int rowCount, int columnCount, Twips columnWidth)
Parameters
noteNoteThe note.
rowCountintThe number of rows.
columnCountintThe number of columns.
columnWidthTwipsThe width of every grid column.
Returns
- Table
The appended table.
Exceptions
- ArgumentNullException
noteis null.- ArgumentOutOfRangeException
rowCountorcolumnCountis negative.