Tables8 min read
Rectangular Table Spans & Auto-Pagination
Handling complex rowspan/gridspan cell merges, row striping, and auto-pagination across slide overflows.
1Row Merging & Nested Data
Standard OpenXML tables can be easily corrupted if vertical merge (vMerge) or horizontal merge (hMerge) attributes are mismatched. node-pptx-templater automatically manages grid coordinates, span calculations, and cell hiding rules.
2Auto-Pagination with splitTableOnOverflow
When dynamically generating tables with 50+ rows from database records, tables frequently spill off the bottom of the slide. splitTableOnOverflow calculates row heights, detects boundary collisions, deep-clones the parent slide, repeats header rows, and paginates rows cleanly across subsequent slides.
javascript
ppt.useSlide(3);
// Add 60 rows from SQL query
for (const record of queryResults) {
ppt.addTableRow('InventoryTable', [
record.sku,
record.name,
record.warehouse,
record.quantity
]);
}
// Automatically split across new slides if it exceeds slide height
await ppt.splitTableOnOverflow('InventoryTable', {
bottomMargin: '1in',
repeatHeaders: 1
});