Skip to content

@shbernal/pptxgenjs


@shbernal/pptxgenjs / index / TableProps

Interface: TableProps

Defined in: core-interfaces.ts:1537

Extends

Extended by

Properties

_arrObjTabHeadRows?

optional _arrObjTabHeadRows?: TableRow[]

Defined in: core-interfaces.ts:1538


align?

optional align?: HAlign

Defined in: core-interfaces.ts:521

Horizontal alignment

Default

ts
'left'

Inherited from

TextBaseProps.align


altText?

optional altText?: string

Defined in: core-interfaces.ts:807

Alt Text value ("How would you describe this object and its contents to someone who is blind?")

  • serialized to the generated object's p:cNvPr descr attribute
  • PowerPoint: [right-click on the object] > "Edit Alt Text..."

Since

v4.0.0

Example

ts
'Quarterly revenue bar chart'

Inherited from

ObjectNameProps.altText


autoPage?

optional autoPage?: boolean

Defined in: core-interfaces.ts:1545

Whether to enable auto-paging

  • auto-paging creates new slides as content overflows a slide

Default

ts
false

autoPageCharWeight?

optional autoPageCharWeight?: number

Defined in: core-interfaces.ts:1554

Auto-paging character weight

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

See

https://gitbrent.github.io/PptxGenJS/docs/api-tables.html

Default

ts
0.0

Example

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

autoPageHeaderRows?

optional autoPageHeaderRows?: number

Defined in: core-interfaces.ts:1578

Number of rows that comprise table headers

  • required when autoPageRepeatHeader is set to true.

Example

ts
2 - repeats the first two table rows on each new slide created

Default

ts
1

Since

v3.3.0


autoPageLineWeight?

optional autoPageLineWeight?: number

Defined in: core-interfaces.ts:1563

Auto-paging line weight

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

See

https://gitbrent.github.io/PptxGenJS/docs/api-tables.html

Default

ts
0.0

Example

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

autoPagePlaceholder?

optional autoPagePlaceholder?: boolean

Defined in: core-interfaces.ts:1591

Whether populated placeholders on the source slide (e.g. a title set via addText(text, { placeholder })) are copied onto each overflow slide created by autoPage.

  • new slides otherwise inherit only the layout's empty placeholders, so a title set on the first slide would not appear on continuation slides (upstream gitbrent/PptxGenJS#1136).

Default

ts
false

autoPageRepeatHeader?

optional autoPageRepeatHeader?: boolean

Defined in: core-interfaces.ts:1570

Whether table header row(s) should be repeated on each new slide creating by autoPage. Use autoPageHeaderRows to designate how many rows comprise the table header (1+).

Default

ts
false

Since

v3.3.0


autoPageSlideStartY?

optional autoPageSlideStartY?: number

Defined in: core-interfaces.ts:1583

The y location to use on subsequent slides created by autopaging

Default

ts
(top margin of Slide)

bold?

optional bold?: boolean

Defined in: core-interfaces.ts:526

Bold style

Default

ts
false

Inherited from

TextBaseProps.bold


border?

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

Defined in: core-interfaces.ts:1597

Table border

  • single value is applied to all 4 sides
  • array of values in TRBL order for individual sides

breakLine?

optional breakLine?: boolean

Defined in: core-interfaces.ts:531

Add a line-break

Default

ts
false

Inherited from

TextBaseProps.breakLine


bullet?

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

Defined in: core-interfaces.ts:547

Add standard or custom bullet

  • use true for standard bullet
  • pass object options for custom bullet

Union Members

boolean


Type Literal

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

characterCode?

optional characterCode?: string

Bullet character code (unicode)

Since

v3.3.0

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

optional code?: string

Bullet code (unicode)

Deprecated

v3.3.0 - use characterCode

color?

optional color?: string

Bullet glyph color (separate from the text run color)

Since

v4.0.0

Example
ts
'FF0000' // red bullet
fontFace?

optional fontFace?: string

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

Since

v4.0.0

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) are recommended; use size to scale relative to the text height
  • takes precedence over type/characterCode when set
Since

v4.0.0

Examples
ts
image: { path: 'images/star.png' }
ts
image: { data: 'image/png;base64,iVBOR...' }
image.data?

optional data?: string

image.path?

optional path?: string

indent?

optional indent?: number

Indentation (space between bullet and text) (points)

Since

v3.3.0

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

optional marginPt?: number

Margin between bullet and text

Since

v3.2.1

Deprecated

v3.3.0 - use indent

numberStartAt?

optional numberStartAt?: number

Number bullets start at

Since

v3.3.0

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

Since

v3.3.0

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)

Since

v4.0.0

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

optional startAt?: number

Number to start with (only applies to type:number)

Deprecated

v3.3.0 - use numberStartAt

style?

optional style?: string

Number type

Deprecated

v3.3.0 - use numberType

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: core-interfaces.ts:663

Text capitalization

  • 'all' = ALL CAPS
  • 'small' = Small Caps
  • 'none' = no override (default)
  • PowerPoint: Font > Effects > All Caps / Small Caps

Inherited from

TextBaseProps.caps


color?

optional color?: string

Defined in: core-interfaces.ts:671

Text color

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

Examples

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

Inherited from

TextBaseProps.color


colW?

optional colW?: number | number[]

Defined in: core-interfaces.ts:1604

Width of table columns (inches)

  • single value is applied to every column equally based upon w
  • array of values in applied to each column in order

Default

columns of equal width based upon w


fill?

optional fill?: ShapeFillProps

Defined in: core-interfaces.ts:1675

Cell background color

Examples

ts
{ color:'FF0000' } // hex color (red)
ts
{ color:'0088CC', transparency:50 } // hex color, 50% transparent
ts
{ color:pptx.SchemeColor.accent1 } // theme color Accent1

fontFace?

optional fontFace?: string

Defined in: core-interfaces.ts:681

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: core-interfaces.ts:689

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: core-interfaces.ts:694

Font size

Example

ts
12 // Font size 12

Inherited from

TextBaseProps.fontSize


h?

optional h?: Coord

Defined in: core-interfaces.ts:47

Height

  • inches or percentage

Examples

ts
10.25 // height in inches
ts
'75%' // height as percentage of slide size

Inherited from

PositionProps.h


hasBandedColumns?

optional hasBandedColumns?: boolean

Defined in: core-interfaces.ts:1632

Enable alternating column (band) shading. Emits bandCol="1" on <a:tblPr>, activating band1V/band2V style regions. Requires tableStyle to have a visible effect.

Default

ts
false

hasBandedRows?

optional hasBandedRows?: boolean

Defined in: core-interfaces.ts:1625

Enable alternating row (band) shading. Emits bandRow="1" on <a:tblPr>, activating band1H/band2H style regions. Requires tableStyle to have a visible effect.

Default

ts
false

hasFirstColumn?

optional hasFirstColumn?: boolean

Defined in: core-interfaces.ts:1639

Apply special styling to the first column. Emits firstCol="1" on <a:tblPr>, activating the firstCol style region. Requires tableStyle to have a visible effect.

Default

ts
false

hasFooter?

optional hasFooter?: boolean

Defined in: core-interfaces.ts:1618

Mark the last row as a footer row. Emits lastRow="1" on <a:tblPr>, activating the last-row style region. Requires tableStyle to have a visible effect.

Default

ts
false

hasHeader?

optional hasHeader?: boolean

Defined in: core-interfaces.ts:1611

Mark the first row as a header row. Emits firstRow="1" on <a:tblPr>, activating the first-row style region of the table style and satisfying the PowerPoint accessibility checker's "table header" rule.

Default

ts
false

hasLastColumn?

optional hasLastColumn?: boolean

Defined in: core-interfaces.ts:1646

Apply special styling to the last column. Emits lastCol="1" on <a:tblPr>, activating the lastCol style region. Requires tableStyle to have a visible effect.

Default

ts
false

highlight?

optional highlight?: string

Defined in: core-interfaces.ts:699

Text highlight color (hex format)

Example

ts
'FFFF00' // yellow

Inherited from

TextBaseProps.highlight


italic?

optional italic?: boolean

Defined in: core-interfaces.ts:704

italic style

Default

ts
false

Inherited from

TextBaseProps.italic


lang?

optional lang?: string

Defined in: core-interfaces.ts:711

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: core-interfaces.ts:1680

Cell margin (inches)

  • affects all table cells, is superceded by cell options

newSlideStartY?

optional newSlideStartY?: number

Defined in: core-interfaces.ts:1698

Deprecated

v3.3.0 - use autoPageSlideStartY


objectLock?

optional objectLock?: ObjectLockProps

Defined in: core-interfaces.ts:819

Object lock flags (DrawingML a:spLocks / a:picLocks / a:graphicFrameLocks)

  • restrict how the object can be manipulated in PowerPoint (e.g. prevent moving, resizing, or grouping)
  • each flag maps 1:1 to the OOXML attribute of the same name; only flags set to true are emitted
  • PowerPoint UI: Selection Pane / right-click protections (most locks are honored at edit time, not as a password)
  • flags only apply to the object types that support them (see each flag); flags set on an unsupported object type are ignored with a console warning

Since

v4.0.0

Examples

ts
{ noMove: true, noResize: true } // pin an object in place
ts
{ noGrp: true } // exclude from grouping

Inherited from

ObjectNameProps.objectLock


objectName?

optional objectName?: string

Defined in: core-interfaces.ts:799

Object name

  • used instead of default "Object N" name
  • PowerPoint: Home > Arrange > Selection Pane...

Since

v3.10.0

Default

ts
'Object 1'

Example

ts
'Antenna Design 9'

Inherited from

ObjectNameProps.objectName


rowH?

optional rowH?: number | number[]

Defined in: core-interfaces.ts:1687

Height of table rows (inches)

  • single value is applied to every row equally based upon h
  • array of values in applied to each row in order

Default

rows of equal height based upon h


rtl?

optional rtl?: boolean

Defined in: core-interfaces.ts:1656

Lay the table out right-to-left. Emits rtl="1" on <a:tblPr>, which mirrors the column order so the first column renders on the right — the correct layout for RTL scripts (Arabic, Hebrew). This controls only the table/column direction; per-cell text direction is set with each cell's rtlMode option.

Default

ts
false

Since

v4.0.0


softBreakBefore?

optional softBreakBefore?: boolean

Defined in: core-interfaces.ts:717

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

Default

ts
false

Since

v3.5.0

Inherited from

TextBaseProps.softBreakBefore


tableStyle?

optional tableStyle?: string

Defined in: core-interfaces.ts:1668

Table style to apply, either a built-in TABLE_STYLE member or the GUID returned by pptx.defineTableStyle() for a custom style. Emits <a:tableStyleId> inside <a:tblPr> with the corresponding GUID. Style flags (hasHeader, hasFooter, hasBandedRows, etc.) select which regions of the chosen style are activated; they have no visible effect without a tableStyle set.

Examples

ts
tableStyle: pptx.TABLE_STYLE.MEDIUM_STYLE_2_ACCENT_1 // built-in
ts
const brand = pptx.defineTableStyle({ name:'Brand', firstRow:{ fill:'1A2B3C', color:'FFFFFF', bold:true } }); tableStyle: brand

tabStops?

optional tabStops?: object[]

Defined in: core-interfaces.ts:723

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: core-interfaces.ts:732

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: core-interfaces.ts:540

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.

Since

v4.0.0

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: core-interfaces.ts:739

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: core-interfaces.ts:745

underline properties

  • PowerPoint: Font > Color & Underline > Underline Style/Underline Color

color?

optional color?: string

style?

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

Default

ts
(none)

Inherited from

TextBaseProps.underline


valign?

optional valign?: VAlign

Defined in: core-interfaces.ts:770

vertical alignment

Default

ts
'top'

Inherited from

TextBaseProps.valign


verbose?

optional verbose?: boolean

Defined in: core-interfaces.ts:1693

DEV TOOL: Verbose Mode (to console)

  • tell the library to provide an almost ridiculous amount of detail during auto-paging calculations

Default

ts
false // obviously

w?

optional w?: Coord

Defined in: core-interfaces.ts:54

Width

  • inches or percentage

Examples

ts
10.25 // width in inches
ts
'75%' // width as percentage of slide size

Inherited from

PositionProps.w


x?

optional x?: Coord

Defined in: core-interfaces.ts:33

Horizontal position

  • inches or percentage

Examples

ts
10.25 // position in inches
ts
'75%' // position as percentage of slide size

Inherited from

PositionProps.x


y?

optional y?: Coord

Defined in: core-interfaces.ts:40

Vertical position

  • inches or percentage

Examples

ts
10.25 // position in inches
ts
'75%' // position as percentage of slide size

Inherited from

PositionProps.y