diff --git a/README.md b/README.md index 8d4aac41..8bbd957e 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ full fledged examples can be found under `example/` - `table` - `row` - `cantSplit` flag to allow table row to split across pages. Defaults to `false`. + - `repeatTableHeader` flag to allow table headers to be repeated across mulitple pages. Defaults to `false`. - `pageNumber` flag to enable page number in footer. Defaults to `false`. Page number works only if footer flag is set as `true`. - `skipFirstHeaderFooter` flag to skip first page header and footer. Defaults to `false`. - `lineNumber` flag to enable line numbering. Defaults to `false`. @@ -157,4 +158,4 @@ MIT -Made with [contrib.rocks](https://contrib.rocks). \ No newline at end of file +Made with [contrib.rocks](https://contrib.rocks). diff --git a/src/helpers/xml-builder.js b/src/helpers/xml-builder.js index d05cfba8..dffae293 100644 --- a/src/helpers/xml-builder.js +++ b/src/helpers/xml-builder.js @@ -1465,6 +1465,16 @@ const buildTableRowProperties = (attributes) => { delete attributes.rowCantSplit; } break; + case 'repeatTableHeader': + if (attributes.repeatTableHeader) { + const headerFragment = fragment({ namespaceAlias: { w: namespaces.w } }) + .ele('@w', 'tblHeader') + .up(); + tableRowPropertiesFragment.import(headerFragment); + // eslint-disable-next-line no-param-reassign + delete attributes.repeatTableHeader; + } + break; } }); }