Button pdfHtml5 creates an output with unexpected styling
Button pdfHtml5 creates an output with unexpected styling

I'm seeing an unexpected change in the pdfHtml5
button between Buttons versions 2.4.2 and 3.0.0.
In the earlier version there were two pdfMake-styles applied to the table's header and footer: tableHeader
and tableFooter
respectively.
In the later (and current) version of Buttons both pdfMake-styles are defined, but tableFooter
is unused, and tableHeader
is being applied to both the header and the footer.
Was it perhaps an unintended copy-paste error in 3.0.0?
This makes it impossible to easily change only the table's footer (by customizing doc.styles.tableFooter
in config.customize(doc)
) without touching the footer's cells.
Applying tableFooter
to the footer's cells in DataTable.ext.buttons.pdfHtml5.action
, and redefining the 'tableFooter' style to also have an {alignment: 'center'}
seems like the correct behaviour.
Answers
Agreed! Many thanks for flagging this up. I've committed the proposed fix and it will be in the next release of Buttons.
Allan