Snippets
- Learn phpdocx in 5 minutes
- Tutorial
- API quick guide
- HTML to Word
- HTML Extended
- Conversion plugin
- Word to HTML
- DOCXPath
- Bulk processing
- DOCXCustomizer
- Digital signature
- Cryptophpdocx
- Right to left languages
- phpdocx CLI command
- Tracking
- Artificial Intelligence
- Blockchain for documents
- JavaScript API
- Compiled mode
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.