w:tcFitText (Fit Cell Text)

Compresses or expands the text within a table cell to exactly fill the cell's width on a single line.

Parent elements

Description

w:tcFitText is a toggle element that forces the text content of a table cell to be rendered at exactly the cell’s width on a single line — shrinking or expanding character spacing as needed. It is analogous to the w:fitText run property but applies at the cell level.

It is defined in ECMA-376 Part 1 §17.4.68.

Attributes

Attribute Type Possible Values Description
w:val ST_OnOff true, false, 1, 0, on, off Enables or disables fit-text scaling. Omitting w:val is equivalent to true.

Examples

<w:tc>
  <w:tcPr>
    <w:tcW w:w="2000" w:type="dxa"/>
    <w:tcFitText/>
  </w:tcPr>
  <w:p><w:r><w:t>Fit this text</w:t></w:r></w:p>
</w:tc>

Notes

  • The cell must have a fixed width (w:tcW with dxa) for w:tcFitText to have a well-defined target width.
  • If the cell contains multiple paragraphs or a run with explicit character spacing, results may vary across renderers.
  • Not to be confused with w:fitText (§17.3.2.14), which acts on individual runs.