Altering cell text in createdCell hook breaks table style
See original GitHub issueAs you can see in the generated pdf, the text in the first column breaks in the middle of words. This happens, because the text of the cell in the last column gets altered in the createdCell hook. This is done to add the currency, because the service responds an integer value like 12000 and not text with the currency already attached. Seems to be a bug to me. Or maybe i did not understand how to “style” text. Is the createdCell hook the wrong place to do that?
I added a plunker as there seems to be a defect with the suggested codepen: https://plnkr.co/edit/SI1X4D2myWwzArH9JrPO?p=preview
off-topic: as you can see in the plunker, there is always the need to do
// prevent 'null' as text in table columns
if (!cell.raw) {
cell.text = '';
}
in the createdCell hook because otherwise a null value would be rendered as text ‘null’. Maybe it would be a small cosmetic feature to automate this.
oh and also note the console output in the latest version. think there is a lost console.log somewhere in the code 😃
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
Added support for setting individual cell widths now. This is done by setting the style
minCellWidth
. It replaces thecolumnWidth
style. This means that you would be able to set for exampleminCellWidth: 'wrap'
for header cells while keepminCellWidth: 'auto'
for body cells. This will be released in the upcoming version 3.Hey,
How did you align the Preis th to the right?
I know it’s been 2 years, maybe something changed in codebase.
Thanks.