Snippets

Fixed table widths using addTable

MS Word default behaviour regarding tables is to expand cell space if its content surpasses its initial size. In order to create a fixed size table with contents that don't enlarge it, it is required to use a fixed style and set the table and column widths:

Otherwise, if a fixed with is not specified, Word uses the autofit style, with which it handles the best possible width fit.

Both the tableWidth (dxa type) and columnWidths options use twips (Twentieth of a Point) as their unit of measurement. As a reference, 8500 twips correspond to the default A4-size section.