Appearance
@shbernal/pptxgenjs / index / TableProps
Interface: TableProps
Defined in: core-interfaces.ts:1499
Extends
Extended by
Properties
_arrObjTabHeadRows?
optional_arrObjTabHeadRows?:TableRow[]
Defined in: core-interfaces.ts:1500
align?
optionalalign?:HAlign
Defined in: core-interfaces.ts:542
Horizontal alignment
Default
ts
'left'Inherited from
altText?
optionalaltText?:string
Defined in: core-interfaces.ts:800
Alt Text value ("How would you describe this object and its contents to someone who is blind?")
- serialized to the generated object's
p:cNvPrdescrattribute - PowerPoint: [right-click on the object] > "Edit Alt Text..."
Example
ts
'Quarterly revenue bar chart'Inherited from
autoPage?
optionalautoPage?:boolean
Defined in: core-interfaces.ts:1517
Whether to enable auto-paging
- auto-paging creates new slides as content overflows a slide
Default
ts
falseautoPageCharWeight?
optionalautoPageCharWeight?:number
Defined in: core-interfaces.ts:1525
Auto-paging character weight
- adjusts how many characters are used before lines wrap
- range: -1.0 to 1.0
Default
ts
0.0Example
ts
0.5 // lines are longer (increases the number of characters that can fit on a given line)autoPageHeaderRows?
optionalautoPageHeaderRows?:number
Defined in: core-interfaces.ts:1546
Number of rows that comprise table headers
- required when
autoPageRepeatHeaderis set to true.
Example
ts
2 - repeats the first two table rows on each new slide createdDefault
ts
1autoPageLineWeight?
optionalautoPageLineWeight?:number
Defined in: core-interfaces.ts:1533
Auto-paging line weight
- adjusts how many lines are used before slides wrap
- range: -1.0 to 1.0
Default
ts
0.0Example
ts
0.5 // tables are taller (increases the number of lines that can fit on a given slide)autoPagePlaceholder?
optionalautoPagePlaceholder?:boolean
Defined in: core-interfaces.ts:1559
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.
Default
ts
falseautoPageRepeatHeader?
optionalautoPageRepeatHeader?:boolean
Defined in: core-interfaces.ts:1539
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
falseautoPageSlideStartY?
optionalautoPageSlideStartY?:number
Defined in: core-interfaces.ts:1551
The y location to use on subsequent slides created by autopaging
Default
ts
(top margin of Slide)bold?
optionalbold?:boolean
Defined in: core-interfaces.ts:547
Bold style
Default
ts
falseInherited from
border?
optionalborder?:BorderProps| [BorderProps,BorderProps,BorderProps,BorderProps]
Defined in: core-interfaces.ts:1565
Table border
- single value is applied to all 4 sides
- array of values in TRBL order for individual sides
breakLine?
optionalbreakLine?:boolean
Defined in: core-interfaces.ts:552
Add a line-break
Default
ts
falseInherited from
bullet?
optionalbullet?:boolean| {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: core-interfaces.ts:567
Add standard or custom bullet
- use
truefor standard bullet - pass object options for custom bullet
Union Members
boolean
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?
optionalcharacterCode?:string
Bullet character code (unicode)
Example
ts
'25BA' // 'BLACK RIGHT-POINTING POINTER' (U+25BA)color?
optionalcolor?:string
Bullet glyph color (separate from the text run color)
Example
ts
'FF0000' // red bulletfontFace?
optionalfontFace?:string
Bullet glyph font typeface (<a:buFont/>), e.g. for symbol-font bullets
Example
ts
'Wingdings' // render `characterCode` using the Wingdings fontimage?
optionalimage?:object
Image to use as the bullet glyph ("picture bullet", <a:buBlip>)
- supply an image
path(filesystem/URL) or base64data(same forms asaddImage()) - raster formats (PNG/JPG/GIF) and SVG are supported; use
sizeto 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/characterCodewhen set
Examples
ts
image: { path: 'images/star.png' }ts
image: { data: 'image/png;base64,iVBOR...' }ts
image: { path: 'images/star.svg' }image.data?
optionaldata?:string
image.path?
optionalpath?:string
indent?
optionalindent?:number
Indentation (space between bullet and text) (points)
Default
ts
27 // DEF_BULLET_MARGINExample
ts
10 // Indents text 10 points from bulletnumberStartAt?
optionalnumberStartAt?:number
Number bullets start at
Default
ts
1Example
ts
10 // numbered bullets start with 10numberType?
optionalnumberType?:"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 rightsize?
optionalsize?:number
Bullet glyph size as a percentage of the run's text size (25–400)
Default
ts
100Example
ts
80 // bullet glyph is 80% of the text sizetype?
optionaltype?:"number"|"bullet"
Bullet type
Default
ts
bulletDefault
ts
falseInherited from
caps?
optionalcaps?:"small"|"all"|"none"
Defined in: core-interfaces.ts:659
Text capitalization
'all'= ALL CAPS'small'= Small Caps'none'= no override (default)- PowerPoint: Font > Effects > All Caps / Small Caps
Inherited from
color?
optionalcolor?:string
Defined in: core-interfaces.ts:667
Text color
HexColororThemeColor- 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
columns?
optionalcolumns?:TableCellProps[]
Defined in: core-interfaces.ts:1715
Per-column default cell styling, applied as direct per-cell formatting.
columns[i] is merged onto every cell that starts in column i (fill, color, bold, align, valign, border, margin, …), so a wide colored matrix — per-column fills, maturity-gradient headers — does not require hand-writing a fill onto every cell. Entries may be sparse (columns[2] alone styles only column 2); an undefined/omitted entry leaves that column untouched. The whole option is optional and degrades cleanly to today's text-on-white when not given.
Precedence (highest wins), matching how PowerPoint resolves styling — direct cell formatting overrides a table-style region:
- explicit per-cell
options headerRow(row 0 only)- this
columns[colIdx] wholeTbl/tableStyle/ defaults
The merge is property-level, so a header cell keeps headerRow's typography and takes its column's fill when they set different properties. For a graduated header band, put shared header typography (bold/white/centered, no fill) in headerRow and let each columns[i].fill supply that column's fill.
Column index counts each cell's colspan (default 1) within a row, so merged cells map to the correct column; it does not track rowspans inherited from earlier rows.
There is deliberately no built-in "group bracket" annotation. Label a span of columns by composing existing primitives: addShape('rightBrace', …) (or 'bracePair') plus addText, positioned from the table's x and colW (a span's x/w is the running sum of the preceding/covered column widths).
Examples
ts
columns: [{}, { fill: { color:'E8F0FE' } }, { fill: { color:'C6DAFC' } }] // per-column solid fillsts
// gradient header: shared typography on headerRow, graduated fills per column
headerRow: { color:'FFFFFF', bold:true, align:'center' },
columns: [{}, { fill:{color:'BBD3FB'} }, { fill:{color:'89AEF6'} }, { fill:{color:'4B7BE5'} }]colW?
optionalcolW?:number|number[]
Defined in: core-interfaces.ts:1572
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?
optionalfill?:ShapeFillProps
Defined in: core-interfaces.ts:1722
Cell background color
Examples
ts
{ color:'FF0000' } // hex color (red)ts
{ color:'0088CC', transparency:50 } // hex color, 50% transparentts
{ color:pptx.SchemeColor.accent1 } // theme color Accent1fit?
optionalfit?:"resize"|"none"|TextFitShrinkProps|"shrink"
Defined in: core-interfaces.ts:1597
Table-level text-fit policy, cascaded to every cell that does not set its own TableCellProps.fit.
'shrink': each cell whose row has a fixed height that its wrapped text would exceed gets a reduced literal font size baked onto its runs so the text fits (see TableCellProps.fit for the full semantics and the font-metrics requirement). Cells that set their ownfitwin over this table default.'none'/'resize'/ the object form are accepted for parity with TextPropsOptions.fit but only'shrink'is acted on for table cells.
Default
ts
undefined (cells keep their authored size)Example
ts
'shrink'fitColumns?
optionalfitColumns?:"shrink"
Defined in: core-interfaces.ts:1584
Shrink columns proportionally so a too-wide table fits the slide.
'shrink': if the total column width exceeds the space available between the table'sxand the right slide margin, scale every column down by the same factor so the whole table fits. Columns that already fit are untouched.- applies to an explicit
colWarray (the common "too many columns" case) and to awwider than the slide; never grows columns and never enforces a minimum width, so a very high column count can still become thin. - opt-in: explicit widths are otherwise emitted as-is and may run off the slide.
Default
ts
undefined (no scaling)fontFace?
optionalfontFace?:string
Defined in: core-interfaces.ts:677
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 fontInherited from
fontFaceEA?
optionalfontFaceEA?:string
Defined in: core-interfaces.ts:685
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 JhengHeiInherited from
fontSize?
optionalfontSize?:number
Defined in: core-interfaces.ts:690
Font size
Example
ts
12 // Font size 12Inherited from
h?
optionalh?:Coord
Defined in: core-interfaces.ts:61
Height
- inches or percentage
Examples
ts
10.25 // height in inchests
'75%' // height as percentage of slide sizeInherited from
hasBandedColumns?
optionalhasBandedColumns?:boolean
Defined in: core-interfaces.ts:1625
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
falsehasBandedRows?
optionalhasBandedRows?:boolean
Defined in: core-interfaces.ts:1618
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
falsehasFirstColumn?
optionalhasFirstColumn?:boolean
Defined in: core-interfaces.ts:1632
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
falsehasFooter?
optionalhasFooter?:boolean
Defined in: core-interfaces.ts:1611
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
falsehasHeader?
optionalhasHeader?:boolean
Defined in: core-interfaces.ts:1604
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
falsehasLastColumn?
optionalhasLastColumn?:boolean
Defined in: core-interfaces.ts:1639
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
falseheaderRow?
optionalheaderRow?:TableCellProps
Defined in: core-interfaces.ts:1679
Inline styling for the header (first) row, applied as direct per-cell formatting.
Convenience shortcut for styling a header distinctly from the body without first registering a custom style via pptx.defineTableStyle({ firstRow }). Each property is merged onto every cell of row 0 (fill, color, bold, align, border, etc.).
Precedence (highest wins), matching how PowerPoint resolves styling — direct cell formatting overrides a table-style region:
- explicit per-cell
optionson a row-0 cell - this
headerRow - the
firstRowregion of anytableStyle wholeTbl/ defaults
Setting headerRow also implies hasHeader: true (emits firstRow="1" for the accessibility "table header" marker) unless hasHeader is explicitly set to false.
Example
ts
headerRow: { fill: { color:'1A2B3C' }, color:'FFFFFF', bold:true, align:'center' }highlight?
optionalhighlight?:string
Defined in: core-interfaces.ts:695
Text highlight color (hex format)
Example
ts
'FFFF00' // yellowInherited from
italic?
optionalitalic?:boolean
Defined in: core-interfaces.ts:700
italic style
Default
ts
falseInherited from
lang?
optionallang?:string
Defined in: core-interfaces.ts:707
language
- ISO 639-1 standard language code
Default
ts
'en-US' // english USExample
ts
'fr-CA' // french CanadianInherited from
margin?
optionalmargin?:Margin
Defined in: core-interfaces.ts:1727
Cell margin (inches)
- affects all table cells, is superceded by cell options
objectLock?
optionalobjectLock?:ObjectLockProps
Defined in: core-interfaces.ts:811
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
trueare 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
Examples
ts
{ noMove: true, noResize: true } // pin an object in placets
{ noGrp: true } // exclude from groupingInherited from
objectName?
optionalobjectName?:string
Defined in: core-interfaces.ts:793
Object name
- used instead of default "Object N" name
- PowerPoint: Home > Arrange > Selection Pane...
Default
ts
'Object 1'Example
ts
'Antenna Design 9'Inherited from
placeholder?
optionalplaceholder?:string
Defined in: core-interfaces.ts:1510
Name of a table/content placeholder defined on the slide layout/master to bind this table to.
- when it matches a layout/master placeholder, the table's
<p:graphicFrame>emits that placeholder's<p:ph>(idx/type) so PowerPoint treats the table as filling the placeholder (e.g. a "Title and Content" content placeholder) - the table also inherits the placeholder's position/size for any of x/y/w/h left unset
Example
ts
'body' // bind to the layout placeholder named 'body'rowH?
optionalrowH?:number|number[]
Defined in: core-interfaces.ts:1734
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?
optionalrtl?:boolean
Defined in: core-interfaces.ts:1648
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
falsesoftBreakBefore?
optionalsoftBreakBefore?:boolean
Defined in: core-interfaces.ts:712
Add a soft line-break (shift+enter) before line text content
Default
ts
falseInherited from
tableStyle?
optionaltableStyle?:string
Defined in: core-interfaces.ts:1660
Table style to apply, either a built-in TableStyle 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.TableStyle.MEDIUM_STYLE_2_ACCENT_1 // built-ints
const brand = pptx.defineTableStyle({ name:'Brand', firstRow:{ fill:'1A2B3C', color:'FFFFFF', bold:true } }); tableStyle: brandtabStops?
optionaltabStops?:object[]
Defined in: core-interfaces.ts:718
tab stops
- PowerPoint: Paragraph > Tabs > Tab stop position
alignment?
optionalalignment?:"r"|"l"|"ctr"|"dec"
position
position:
number
Example
ts
[{ position:1 }, { position:3 }] // Set first tab stop to 1 inch, set second tab stop to 3 inchesInherited from
textDirection?
optionaltextDirection?:"horz"|"vert"|"vert270"|"wordArtVert"
Defined in: core-interfaces.ts:727
text direction horz = horizontal vert = rotate 90^ vert270 = rotate 270^ wordArtVert = stacked
Default
ts
'horz'Inherited from
textWarp?
optionaltextWarp?:string
Defined in: core-interfaces.ts:560
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
transparency?
optionaltransparency?:number
Defined in: core-interfaces.ts:734
Transparency (percent)
- MS-PPT > Format Shape > Text Options > Text Fill & Outline > Text Fill > Transparency
- range: 0-100
Default
ts
0Inherited from
underline?
optionalunderline?:object
Defined in: core-interfaces.ts:740
underline properties
- PowerPoint: Font > Color & Underline > Underline Style/Underline Color
color?
optionalcolor?:string
style?
optionalstyle?:"none"|"dash"|"dashHeavy"|"dashLong"|"dashLongHeavy"|"dbl"|"dotDash"|"dotDashHeave"|"dotDotDash"|"dotDotDashHeavy"|"dotted"|"dottedHeavy"|"heavy"|"sng"|"wavy"|"wavyDbl"|"wavyHeavy"
Default
ts
(none)Inherited from
valign?
optionalvalign?:VAlign
Defined in: core-interfaces.ts:765
vertical alignment
Default
ts
'top'Inherited from
verbose?
optionalverbose?:boolean
Defined in: core-interfaces.ts:1740
DEV TOOL: Verbose Mode (to console)
- tell the library to provide an almost ridiculous amount of detail during auto-paging calculations
Default
ts
false // obviouslyw?
optionalw?:Coord
Defined in: core-interfaces.ts:68
Width
- inches or percentage
Examples
ts
10.25 // width in inchests
'75%' // width as percentage of slide sizeInherited from
x?
optionalx?:Coord
Defined in: core-interfaces.ts:47
Horizontal position
- inches or percentage
Examples
ts
10.25 // position in inchests
'75%' // position as percentage of slide sizeInherited from
y?
optionaly?:Coord
Defined in: core-interfaces.ts:54
Vertical position
- inches or percentage
Examples
ts
10.25 // position in inchests
'75%' // position as percentage of slide size