---
canonical_url: "https://tiptap.dev/docs/conversion/export/_shared/_element-overrides-rest-api"
---

The five element override objects let you tune how individual DOCX elements
(tables, paragraphs, text runs, table cells, images) are rendered. Each
override is forwarded to the underlying DOCX conversion library as a base
default; per-node values from the document still win where they are computed.

> **No deep merging:**
>
> Nested objects inside an override (for example `borders`, `margins`, `transformation`) are **replaced entirely**, not deep-merged. When customizing one side of a border, provide every side you need so undefined values do not slip through.

#### `tableOverrides`

Defaults applied to every table. Most useful properties:

| Property              | Type      | Description                                                                                                                             |
| --------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `borders`             | `Object`  | Per-side definitions for `top`, `bottom`, `left`, `right`, `insideHorizontal`, `insideVertical`. Each accepts `{ style, size, color }`. |
| `margins`             | `Object`  | Default cell margins `{ top, bottom, left, right }` (twentieths of a point).                                                            |
| `width`               | `Object`  | Table width `{ size, type }` where `type` is `"pct"`, `"dxa"`, or `"auto"`.                                                             |
| `layout`              | `string`  | `"fixed"` or `"autofit"`.                                                                                                               |
| `alignment`           | `string`  | `"left" \| "center" \| "right" \| "start" \| "end"`.                                                                                    |
| `cantSplit`           | `boolean` | Prevent the table from splitting across pages.                                                                                          |
| `visuallyRightToLeft` | `boolean` | Render the table right-to-left.                                                                                                         |

#### `paragraphOverrides`

Defaults applied to every paragraph. Most useful properties:

| Property          | Type      | Description                                                                                                  |
| ----------------- | --------- | ------------------------------------------------------------------------------------------------------------ |
| `spacing`         | `Object`  | `{ before, after, line, lineRule }` in twentieths of a point. `line` is overwritten by computed line height. |
| `alignment`       | `string`  | `"left" \| "center" \| "right" \| "justified" \| "start" \| "end"`.                                          |
| `indent`          | `Object`  | `{ left, right, firstLine, hanging, start, end }` in twentieths of a point.                                  |
| `keepNext`        | `boolean` | Keep this paragraph with the next one.                                                                       |
| `keepLines`       | `boolean` | Keep all lines in the paragraph together.                                                                    |
| `pageBreakBefore` | `boolean` | Insert a page break before the paragraph.                                                                    |
| `bidirectional`   | `boolean` | Render paragraph right-to-left.                                                                              |
| `style`           | `string`  | Reference to a paragraph style id defined in `styleOverrides`.                                               |

#### `textRunOverrides`

Defaults applied to every text run. Per-mark formatting (bold, italic, color,
…) still overrides these values. Most useful properties:

| Property      | Type      | Description                                                  |
| ------------- | --------- | ------------------------------------------------------------ |
| `font`        | `string`  | Font family name.                                            |
| `size`        | `number`  | Font size in half-points (`24` = 12pt).                      |
| `bold`        | `boolean` | Render bold by default.                                      |
| `italics`     | `boolean` | Render italic by default.                                    |
| `underline`   | `Object`  | `{ type, color }`, e.g. `{ type: "single", color: "auto" }`. |
| `strike`      | `boolean` | Strikethrough.                                               |
| `color`       | `string`  | Hex color without the leading `#` (`"FF0000"`).              |
| `highlight`   | `string`  | Predefined highlight color name (`"yellow"`, `"green"`, …).  |
| `superScript` | `boolean` | Render as superscript.                                       |
| `subScript`   | `boolean` | Render as subscript.                                         |

#### `tableCellOverrides`

Defaults applied to every table cell. Most useful properties:

| Property        | Type     | Description                                                               |
| --------------- | -------- | ------------------------------------------------------------------------- |
| `shading`       | `Object` | `{ fill, type, color }`, e.g. `{ fill: "F0F0F0", type: "clear" }`.        |
| `verticalAlign` | `string` | `"top" \| "center" \| "bottom"`.                                          |
| `borders`       | `Object` | Per-side cell border definitions, same shape as `tableOverrides.borders`. |
| `margins`       | `Object` | Cell padding `{ top, bottom, left, right }` in twentieths of a point.     |
| `width`         | `Object` | Cell width `{ size, type }`.                                              |

#### `imageOverrides`

Defaults applied to every image. Image dimensions computed from the document
(intrinsic size or user-resized values) still win where present. Most useful
properties:

| Property         | Type     | Description                                                     |
| ---------------- | -------- | --------------------------------------------------------------- |
| `transformation` | `Object` | `{ width, height, rotation?, flip? }`, in pixels at 96 dpi.     |
| `altText`        | `Object` | `{ title, description, name }`.                                 |
| `floating`       | `Object` | Floating positioning options (anchor, alignment, offset, wrap). |

#### `headerFooterOverrides`

Scopes the same five element overrides to header/footer content only. Each
field you omit falls back to the body-wide override of the same name. This
only applies when a header or footer slot is passed as Tiptap JSON (an object
or stringified JSONContent); plain-text slots are unaffected. A common use
case is bordered tables in the document body with borderless tables in the
header.

| Property             | Type     | Description                                                           |
| -------------------- | -------- | --------------------------------------------------------------------- |
| `tableOverrides`     | `Object` | Same shape as the top-level override, applied inside headers/footers. |
| `paragraphOverrides` | `Object` | Same shape as the top-level override, applied inside headers/footers. |
| `textRunOverrides`   | `Object` | Same shape as the top-level override, applied inside headers/footers. |
| `tableCellOverrides` | `Object` | Same shape as the top-level override, applied inside headers/footers. |
| `imageOverrides`     | `Object` | Same shape as the top-level override, applied inside headers/footers. |
