Class TableFormattingEditingExtensions
A table's, its rows' and its cells' formatting changed as undoable edits (Word's Table Design and Layout tabs), as
Word writes them (WQ-0099, tools/Probe-WordTableDesign.ps1).
public static class TableFormattingEditingExtensions
- Inheritance
-
TableFormattingEditingExtensions
- Inherited Members
Remarks
A span names a block of cells: the rows from the start's to the end's, and in each the cells from the start's index to the end's (the rectangle Word selects), both ends in one table (the innermost that holds both). A caret names its cell. Each change runs on copies of the formats it touches, swapped in; undo puts back the instances.
Methods
- ApplyTableStyle(WordDocument, Table, Style, Style?)
Applies a table style as Word's Table Design gallery does (WQ-0122), adding its definition when the document lacks it: the table takes the style and Word's style options (header row, first column, banded rows:
w:tblLook04A0), and loses its own borders and its cells' shading and borders, which would hide the style's. Text formatting in the cells stays. One edit, which also takes away a definition it added.
- FindTable(DocumentPosition)
The innermost table a position is in, or null.
- FormatCells(WordDocument, DocumentSpan, Action<CellFormat>)
Changes the format of the cells a span covers (shading, borders, vertical alignment, margins) as one edit.
- FormatRows(WordDocument, DocumentSpan, Action<RowFormat>)
Changes the format of the rows a span touches (header row, height, can't split) as one edit.
- FormatTable(WordDocument, Table, Action<TableFormat>)
Changes a table's format (style, style options, borders, shading, alignment, width) as one edit.
- SetCellBorders(WordDocument, DocumentSpan, CellBorderSides, BorderEdge?)
Sets borders on a block of cells as Word's Borders gallery does: the edges asked for get the edge given (or no border when it is null), and a cell outside the block that shares one of those edges gets it too, so the two sides of the edge agree (WQ-0099).