Skip to content

@shbernal/ts-pptx


@shbernal/ts-pptx / index / TableCellProps

Interface: TableCellProps

Defined in: src/types/table.ts:176

Extends

Extended by

Properties

align?

optional align?: HAlign

Defined in: src/types/text.ts:18

Horizontal alignment

Default

ts
'left'

Inherited from

TextBaseProps.align


anchorCtr?

optional anchorCtr?: boolean

Defined in: src/types/table.ts:225

Centre the cell's whole text block horizontally within the cell (a:tcPr/@anchorCtr), independent of each paragraph's own align.

The two do different things and compose: align decides where each line sits inside the text block, anchorCtr decides where that block sits inside the cell. With left-aligned text in a wide cell, anchorCtr: true centres the ragged-right column of lines as a unit while keeping their left edges flush with each other.

false is the schema default, so it emits nothing — the same reasoning as horzOverflow: 'clip'.

Default

ts
false

autoPageCharWeight?

optional autoPageCharWeight?: number

Defined in: src/types/table.ts:184

Auto-paging character weight

  • adjusts how many characters are used before lines wrap
  • range: -1.0 to 1.0

Default

ts
0.0

Example

ts
0.5 // lines are longer (increases the number of characters that can fit on a given line)

autoPageLineWeight?

optional autoPageLineWeight?: number

Defined in: src/types/table.ts:192

Auto-paging line weight

  • adjusts how many lines are used before slides wrap
  • range: -1.0 to 1.0

Default

ts
0.0

Example

ts
0.5 // tables are taller (increases the number of lines that can fit on a given slide)

bold?

optional bold?: boolean

Defined in: src/types/text.ts:23

Bold style

Default

ts
false

Inherited from

TextBaseProps.bold


border?

optional border?: BorderProps | [BorderProps, BorderProps, BorderProps, BorderProps]

Defined in: src/types/table.ts:202

The cell's four edge borders (a:tcPr/a:lnT|lnR|lnB|lnL).

  • a single BorderProps is broadcast to all four sides
  • an array is read in TRBL order ([top, right, bottom, left])

Overrides the table-level TableProps.border default entirely — the two do not merge per side. For the two corner-to-corner rules see diagonal; for the table's outside edge see TableProps.outerBorder.


breakLine?

optional breakLine?: boolean

Defined in: src/types/text.ts:28

Add a line-break

Default

ts
false

Inherited from

TextBaseProps.breakLine


bullet?

optional bullet?: boolean | "inherit" | { characterCode?: string; color?: string; fontFace?: string; image?: { data?: string; path?: string; }; indent?: number; numberStartAt?: number; numberType?: "alphaLcParenBoth" | "alphaLcParenR" | "alphaLcPeriod" | "alphaUcParenBoth" | "alphaUcParenR" | "alphaUcPeriod" | "arabicParenBoth" | "arabicParenR" | "arabicPeriod" | "arabicPlain" | "romanLcParenBoth" | "romanLcParenR" | "romanLcPeriod" | "romanUcParenBoth" | "romanUcParenR" | "romanUcPeriod"; size?: number; type?: "number" | "bullet"; }

Defined in: src/types/text.ts:53

Add standard or custom bullet

  • use true for standard bullet
  • pass object options for custom bullet
  • false (and omitting the option) is the explicit off: it writes <a:buNone/> plus marL="0" indent="0", which overrides whatever bullet the layout's or master's list style sets for this level
  • 'inherit' states nothing at all — no bullet child and no margin attributes — so the list style keeps reaching the paragraph. This is the one state omission cannot spell, because omitting the option means false here for compatibility

The margins are only a default of the bullet state: paraMarginLeft and paraIndent state @marL/@indent independently in any of the three, including an inherited margin under a drawn bullet.

Union Members

boolean


"inherit"


Type Literal

{ characterCode?: string; color?: string; fontFace?: string; image?: { data?: string; path?: string; }; indent?: number; numberStartAt?: number; numberType?: "alphaLcParenBoth" | "alphaLcParenR" | "alphaLcPeriod" | "alphaUcParenBoth" | "alphaUcParenR" | "alphaUcPeriod" | "arabicParenBoth" | "arabicParenR" | "arabicPeriod" | "arabicPlain" | "romanLcParenBoth" | "romanLcParenR" | "romanLcPeriod" | "romanUcParenBoth" | "romanUcParenR" | "romanUcPeriod"; size?: number; type?: "number" | "bullet"; }

characterCode?

optional characterCode?: string

Bullet character code (unicode)

Example
ts
'25BA' // 'BLACK RIGHT-POINTING POINTER' (U+25BA)
color?

optional color?: string

Bullet glyph color (separate from the text run color)

Example
ts
'FF0000' // red bullet
fontFace?

optional fontFace?: string

Bullet glyph font typeface (<a:buFont/>), e.g. for symbol-font bullets

Example
ts
'Wingdings' // render `characterCode` using the Wingdings font
image?

optional image?: object

Image to use as the bullet glyph ("picture bullet", <a:buBlip>)

  • supply an image path (filesystem/URL) or base64 data (same forms as addImage())
  • raster formats (PNG/JPG/GIF) and SVG are supported; use size to scale relative to the text height
  • SVG bullets embed a PNG preview plus the SVG (the same dual-rel handling as addImage())
  • takes precedence over type/characterCode when set
Examples
ts
image: { path: 'images/star.png' }
ts
image: { data: 'image/png;base64,iVBOR...' }
ts
image: { path: 'images/star.svg' }
image.data?

optional data?: string

image.path?

optional path?: string

indent?

optional indent?: number

Indentation (space between bullet and text) (points)

Default
ts
27 // DEF_BULLET_MARGIN
Example
ts
10 // Indents text 10 points from bullet
numberStartAt?

optional numberStartAt?: number

Number bullets start at

Default
ts
1
Example
ts
10 // numbered bullets start with 10
numberType?

optional numberType?: "alphaLcParenBoth" | "alphaLcParenR" | "alphaLcPeriod" | "alphaUcParenBoth" | "alphaUcParenR" | "alphaUcPeriod" | "arabicParenBoth" | "arabicParenR" | "arabicPeriod" | "arabicPlain" | "romanLcParenBoth" | "romanLcParenR" | "romanLcPeriod" | "romanUcParenBoth" | "romanUcParenR" | "romanUcPeriod"

Number type

Example
ts
'romanLcParenR' // roman numerals lower-case with paranthesis right
size?

optional size?: number

Bullet glyph size as a percentage of the run's text size (25–400)

Default
ts
100
Example
ts
80 // bullet glyph is 80% of the text size
type?

optional type?: "number" | "bullet"

Bullet type

Default
ts
bullet

Default

ts
false

Inherited from

TextBaseProps.bullet


caps?

optional caps?: "small" | "all" | "none"

Defined in: src/types/text.ts:149

Text capitalization (a:rPr/@cap, ST_TextCapsType)

  • 'all' = ALL CAPS
  • 'small' = Small Caps
  • 'none' = the explicit off: it writes cap="none", which overrides a capitalization the run would otherwise inherit. Omitting the option states nothing and lets that inheritance stand
  • PowerPoint: Font > Effects > All Caps / Small Caps

Default

ts
(unset) inherit

Inherited from

TextBaseProps.caps


cell3D?

optional cell3D?: TableCell3DProps

Defined in: src/types/table.ts:231

A 3-D bevel on the cell (a:tcPr/a:cell3D). Niche: PowerPoint's table UI has no control for it, so it reaches a deck from a theme or another producer, and this exists to author and reproduce one. See TableCell3DProps.


color?

optional color?: string

Defined in: src/types/text.ts:157

Text color

  • HexColor or ThemeColor
  • MS-PPT > Format Shape > Text Options > Text Fill & Outline > Text Fill > Color

Examples

ts
'FF0000' // hex color (red)
ts
SchemeColor.text1 // Theme color (Text1)

Inherited from

TextBaseProps.color


colspan?

optional colspan?: number

Defined in: src/types/table.ts:235

Cell colspan


diagonal?

optional diagonal?: TableCellDiagonals

Defined in: src/types/table.ts:211

The cell's corner-to-corner rules — PowerPoint's "Diagonal Down/Up Border".

Kept off border's tuple on purpose: see TableCellDiagonals. A diagonal on a merged cell is one stroke across the whole region, so only the span origin carries it — the covered cells inherit the origin's edges but never its diagonals.

Example

ts
diagonal: { tlToBr: { type:'solid', color:'C00000' } } // strike the cell out

fill?

optional fill?: ShapeFillProps

Defined in: src/types/table.ts:247

Cell fill — a solid color, or a picture that fills the cell (a:blipFill in the cell's a:tcPr, stretched to the cell box). A picture fill embeds the image as slide media; identical sources are embedded once. Raster only — an SVG source warns and is ignored, matching shape fills.

Examples

ts
{ color:'FF0000' } // hex color (red)
ts
{ color:'0088CC', transparency:50 } // hex color, 50% transparent
ts
{ color:SchemeColor.accent1 } // theme color Accent1
ts
{ type:'image', image:{ path:'logo.png' } } // picture fill
ts
{ image:{ data:'image/png;base64,…' } } // picture fill, `type` inferred

fit?

optional fit?: "resize" | "none" | TextFitShrinkProps | "shrink"

Defined in: src/types/table.ts:293

Shrink cell text to fit when it would overflow the cell's fixed height.

  • 'shrink' measures the wrapped text and bakes a reduced literal font size onto the cell's runs so the text fits — PowerPoint does not support text autofit (normAutofit) inside table cells, so there is no font-scale flag to set; the size itself is lowered, which both PowerPoint and LibreOffice render identically with no edit/resize.
  • Requires the cell font registered via TsPptx.registerFontMetrics; without metrics it is a no-op (the cell keeps its authored size) and warns once.
  • Only triggers when the cell's row has a fixed height that the text exceeds. With auto-height rows (no rowH/h), the row simply grows, so nothing shrinks.
  • Only 'shrink' is acted on for cells. 'resize' and the object form are ignored here: a table row already auto-grows to fit its tallest cell (the cell equivalent of spAutoFit), so there is nothing to bake. (The wider union is shared with TextPropsOptions.fit so table-level fit can cascade to cells.)

Example

ts
'shrink' // measured when the cell font is registered; else no-op

fontFace?

optional fontFace?: string

Defined in: src/types/text.ts:167

Font face name

Applied to the Latin (<a:latin>) and complex-script (<a:cs>) font slots, matching how PowerPoint writes a font picked from the UI. The East Asian slot (<a:ea>) is left to inherit from the theme unless fontFaceEA is set — forcing a Latin-only face into the East Asian slot duplicates/ghosts text in Office 365.

Example

ts
'Arial' // Arial font

Inherited from

TextBaseProps.fontFace


fontFaceEA?

optional fontFaceEA?: string

Defined in: src/types/text.ts:175

East Asian font face name (<a:ea> slot), used to render CJK (Chinese/Japanese/Korean) glyphs

Set this when the East Asian font differs from fontFace. When omitted, <a:ea> inherits the theme East Asian font, which is what PowerPoint does for Latin fonts.

Example

ts
'微軟正黑體' // render East Asian glyphs with Microsoft JhengHei

Inherited from

TextBaseProps.fontFaceEA


fontSize?

optional fontSize?: number

Defined in: src/types/text.ts:180

Font size

Example

ts
12 // Font size 12

Inherited from

TextBaseProps.fontSize


highlight?

optional highlight?: string

Defined in: src/types/text.ts:185

Text highlight color (hex format)

Example

ts
'FFFF00' // yellow

Inherited from

TextBaseProps.highlight


horzOverflow?

optional horzOverflow?: "clip" | "overflow"

Defined in: src/types/table.ts:265

What happens to a single glyph wider than the cell's text width (a:tcPr/@horzOverflow).

  • 'clip' (PowerPoint's default) cuts the glyph off at the cell edge
  • 'overflow' lets it draw past the edge, over whatever is beside it

This is not a text-wrap switch, despite the name. Lines always wrap to the column width; only an individual character too wide to fit on a line by itself is affected, so it matters for oversized display type, wide CJK/emoji glyphs, and icon fonts in a narrow column. PowerPoint has no per-cell no-wrap at all — wrap="none" on a cell's a:bodyPr is discarded on the next save (probe: test/read/fixtures/authoring/probe-table-cell-wrap.ps1). 'clip' is written as asked but is the schema default, so PowerPoint drops the attribute again the first time it saves the deck — the visible result is the same either way, and leaving this unset emits nothing at all.

Default

ts
(unset — PowerPoint clips)

Example

ts
'overflow' // a 60pt glyph in a 0.5in column draws whole instead of being cut

optional hyperlink?: HyperlinkProps

Defined in: src/types/table.ts:266


italic?

optional italic?: boolean

Defined in: src/types/text.ts:190

italic style

Default

ts
false

Inherited from

TextBaseProps.italic


lang?

optional lang?: string

Defined in: src/types/text.ts:197

language

  • ISO 639-1 standard language code

Default

ts
'en-US' // english US

Example

ts
'fr-CA' // french Canadian

Inherited from

TextBaseProps.lang


margin?

optional margin?: Margin

Defined in: src/types/table.ts:271

Cell margin (inches)

Default

ts
0

paraIndent?

optional paraIndent?: number | "inherit"

Defined in: src/types/text.ts:214

First-line indent (points) — a:pPr/@indent, the offset of the paragraph's FIRST line from paraMarginLeft. Negative hangs the first line to the left of the body, which is what a bulleted paragraph does; positive indents it to the right, the "first line indented" prose form. PowerPoint: Paragraph > Indentation > Special.

  • 'inherit' writes no @indent at all, so the paragraph takes whatever its list style (a:lstStyle → placeholder → layout → master) sets — the same third state bullet spells, on the attribute beside it
  • omitting the option keeps the bullet-derived default: a drawn bullet hangs the first line by its margin, bullet: false writes indent="0", bullet: 'inherit' writes nothing
  • a value here overrides all of those, in every bullet state

Examples

ts
-18 // hang the first line 18pt left of the body text
ts
18 // indent the first line 18pt, prose style
ts
'inherit' // keep the list style's indent, even on a bulleted paragraph

Inherited from

TextBaseProps.paraIndent


paraMarginLeft?

optional paraMarginLeft?: number | "inherit"

Defined in: src/types/text.ts:229

Left margin of the paragraph (points) — a:pPr/@marL, where the paragraph's body text starts. This is the paragraph's own margin, not the text frame's internal padding (margin) and not the discrete outline level (indentLevel, which writes a:p/@lvl). PowerPoint: Paragraph > Indentation > Before text.

  • 'inherit' writes no @marL at all, so the paragraph takes whatever its list style (a:lstStyle → placeholder → layout → master) sets — the third state that omission cannot spell, since omitting it writes the bullet-derived default
  • omitting the option keeps that default: a drawn bullet writes its own margin (see bullet.indent), bullet: false writes marL="0", bullet: 'inherit' writes nothing
  • a value here overrides all of those, in every bullet state

Examples

ts
36 // body text starts 36pt (0.5in) from the frame's text edge
ts
'inherit' // keep the list style's margin, even on a bulleted paragraph

Inherited from

TextBaseProps.paraMarginLeft


rowspan?

optional rowspan?: number

Defined in: src/types/table.ts:275

Cell rowspan


softBreakBefore?

optional softBreakBefore?: boolean

Defined in: src/types/text.ts:234

Add a soft line-break (shift+enter) before line text content

Default

ts
false

Inherited from

TextBaseProps.softBreakBefore


tabStops?

optional tabStops?: object[]

Defined in: src/types/text.ts:240

tab stops

  • PowerPoint: Paragraph > Tabs > Tab stop position

alignment?

optional alignment?: "r" | "ctr" | "l" | "dec"

position

position: number

Example

ts
[{ position:1 }, { position:3 }] // Set first tab stop to 1 inch, set second tab stop to 3 inches

Inherited from

TextBaseProps.tabStops


textDirection?

optional textDirection?: "horz" | "vert" | "vert270" | "wordArtVert"

Defined in: src/types/text.ts:249

text direction horz = horizontal vert = rotate 90^ vert270 = rotate 270^ wordArtVert = stacked

Default

ts
'horz'

Inherited from

TextBaseProps.textDirection


textWarp?

optional textWarp?: string

Defined in: src/types/text.ts:36

Preset text warp / WordArt shape (<a:bodyPr><a:prstTxWarp prst="..">), which bends the text along a preset path (arch, circle, wave, …). The value is an OOXML ST_TextShapeType preset name.

Examples

ts
'textArchUp' // bend text along an upward arch (e.g. a label following a ring/arc)
ts
'textCircle'

Inherited from

TextBaseProps.textWarp


transparency?

optional transparency?: number

Defined in: src/types/text.ts:256

Transparency (percent)

  • MS-PPT > Format Shape > Text Options > Text Fill & Outline > Text Fill > Transparency
  • range: 0-100

Default

ts
0

Inherited from

TextBaseProps.transparency


underline?

optional underline?: object

Defined in: src/types/text.ts:267

underline properties

  • PowerPoint: Font > Color & Underline > Underline Style/Underline Color
  • style is the full ST_TextUnderlineType enumeration (ECMA-376 §20.1.10.81)
  • 'none' is the explicit off: it writes a:rPr/@u="none", which overrides an underline the run would otherwise inherit from its list style, placeholder, layout or master. Omitting the option instead states nothing and lets that inheritance stand — the two are different facts, not two spellings of one.

color?

optional color?: string

style?

optional style?: "none" | "dash" | "dashHeavy" | "dashLong" | "dashLongHeavy" | "dbl" | "dotDash" | "dotDashHeavy" | "dotDotDash" | "dotDotDashHeavy" | "dotted" | "dottedHeavy" | "heavy" | "sng" | "wavy" | "wavyDbl" | "wavyHeavy" | "words"

Default

ts
(unset) inherit

Inherited from

TextBaseProps.underline


valign?

optional valign?: VAlign

Defined in: src/types/text.ts:293

vertical alignment

Default

ts
'top'

Inherited from

TextBaseProps.valign