Appearance
@shbernal/pptxgenjs / index / TableStyleProps
Interface: TableStyleProps
Defined in: core-interfaces.ts:1507
A reusable custom table style written to ppt/tableStyles.xml. Pass to pptx.defineTableStyle(), which registers it and returns a GUID to use as TableProps.tableStyle. Unlike the fixed built-in TABLE_STYLE set, a custom style can use arbitrary brand colors, is editable in PowerPoint's Table Styles gallery, and bands correctly across any row/column count (including auto-paged tables).
Example
ts
const brand = pptx.defineTableStyle({
name: 'Brand Banded',
wholeTbl: { border: { type:'solid', color:'D9D9D9', pt:0.5 } },
firstRow: { fill:'1A2B3C', color:'FFFFFF', bold:true },
band1H: { fill:'EAF1F8' },
band2H: { fill:'FFFFFF' },
})
slide.addTable(rows, { tableStyle: brand, hasHeader:true, hasBandedRows:true })Properties
band1H?
optionalband1H?:TableStyleRegionProps
Defined in: core-interfaces.ts:1521
Odd horizontal band — activated by TableProps.hasBandedRows.
band1V?
optionalband1V?:TableStyleRegionProps
Defined in: core-interfaces.ts:1525
Odd vertical band — activated by TableProps.hasBandedColumns.
band2H?
optionalband2H?:TableStyleRegionProps
Defined in: core-interfaces.ts:1523
Even horizontal band — activated by TableProps.hasBandedRows.
band2V?
optionalband2V?:TableStyleRegionProps
Defined in: core-interfaces.ts:1527
Even vertical band — activated by TableProps.hasBandedColumns.
firstCol?
optionalfirstCol?:TableStyleRegionProps
Defined in: core-interfaces.ts:1517
First column — activated by TableProps.hasFirstColumn.
firstRow?
optionalfirstRow?:TableStyleRegionProps
Defined in: core-interfaces.ts:1513
Header (first) row — activated by TableProps.hasHeader.
lastCol?
optionallastCol?:TableStyleRegionProps
Defined in: core-interfaces.ts:1519
Last column — activated by TableProps.hasLastColumn.
lastRow?
optionallastRow?:TableStyleRegionProps
Defined in: core-interfaces.ts:1515
Footer (last) row — activated by TableProps.hasFooter.
name
name:
string
Defined in: core-interfaces.ts:1509
Display name shown in PowerPoint's Table Styles gallery.
wholeTbl?
optionalwholeTbl?:TableStyleRegionProps
Defined in: core-interfaces.ts:1511
Base styling applied to every cell.