-
-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic table widths update #208
Comments
Yes, an update has been made a few days ago about the sizing of tables. Coud you please provide the HTML code that you pass to this library? |
Sure. I get the content from tinyMCE. Looks like the wild card character * is removed as an option? This is not working:
|
cc @nonam4 who did the last release. |
@mortenfa try setting tinymce |
I've just published a new version (v2.5.4) that will replace |
Thanks to both of you! |
@Aymkdn I can confirm that the first problem is solved. But when setting table width to 100% without setting the cell widths, the table is still rendered like this in the pdf: Code snip: |
@mortenfa I noticed that your table html doesn't have |
There was an incorrect variable in the code. I fixed it in v2.5.5 Also, make sure you use the option <table class="table table-condensed" style="width: 100%;"><thead><tr><th>Dato</th><th>Navn</th><th>Beskrivelse</th><th>Tid (timer)</th><th>Beløb i DKK</th></tr></thead><tbody><tr><td>MSD</td><td>Martin Spittau Dupont</td><td>IT-forretningskonsulent</td><td>50,00</td><td style="text-align: right;">17:45</td></tr><tr><td>JBS</td><td>Jacob Brønnum-Schou</td><td>Head of IT</td><td>50,00</td><td style="text-align: right;">4:00</td></tr><tr><td colspan="4">Total</td><td style="text-align: right;">21:45</td></tr></tbody></table> |
Cool, I'll try this. Thanks. Working now, thanks again |
For the last couple of days (update?) I'm getting "html-table","table","table-condensed"]}]],"widths":["10.5%","NaN%","NaN%","NaN%","10.5%"],"heights":["auto","auto","auto","auto","auto"]
I'm using the cdn: https://cdn.jsdelivr.net/npm/html-to-pdfmake/browser.js
The returned object:
{"pageSize":"A4","pageMargins":[60,120,40,80],"pageOrientation":"portrait","content":[{"text":"Salærspecifikation for sag vedr. Coop Danmark A/S Regulatorisk rådgivning\r\nVores sagsnummer 1070510\r\nFakturanummer: F413577","margin":[0,0,0,20],"fontSize":9,"bold":true},[{"text":"Notaen omfatter juridisk assistance ydet i februar 2024 i forbindelse med gennemgang og revidering af vilkår for lokalt købekort.","nodeName":"P","margin":[0,5,0,10],"fontSize":9,"style":["html-p"]},{"text":" "},{"nodeName":"TABLE","marginBottom":5,"fontSize":9,"width":"70%","style":["html-table","table","table-condensed"],"table":{"body":[[{"text":"Initialer","nodeName":"TH","fontSize":9,"bold":true,"fillColor":"#EEEEEE","width":"15%","style":["html-th","html-tr","html-thead","html-table","table","table-condensed","active"]},{"text":"Medarbejdernavn","nodeName":"TH","fontSize":9,"bold":true,"fillColor":"#EEEEEE","width":"*","style":["html-th","html-tr","html-thead","html-table","table","table-condensed","active"]},{"text":"Medarbejdertitel","nodeName":"TH","fontSize":9,"bold":true,"fillColor":"#EEEEEE","width":"*","style":["html-th","html-tr","html-thead","html-table","table","table-condensed","active"]},{"text":"Timesats","nodeName":"TH","fontSize":9,"bold":true,"fillColor":"#EEEEEE","width":"*","style":["html-th","html-tr","html-thead","html-table","table","table-condensed","active"]},{"text":"Total tid","nodeName":"TH","fontSize":9,"bold":true,"fillColor":"#EEEEEE","alignment":"right","width":"15%","style":["html-th","html-tr","html-thead","html-table","table","table-condensed","active"]}],[{"text":"AMGU","nodeName":"TD","fontSize":9,"style":["html-td","html-tr","html-tbody","html-table","table","table-condensed"]},{"text":"Anne-Marie Guldbrandsen","nodeName":"TD","fontSize":9,"style":["html-td","html-tr","html-tbody","html-table","table","table-condensed"]},{"text":"Senior Associate, Advokat","nodeName":"TD","fontSize":9,"style":["html-td","html-tr","html-tbody","html-table","table","table-condensed"]},{"text":"3.700,00","nodeName":"TD","fontSize":9,"style":["html-td","html-tr","html-tbody","html-table","table","table-condensed"]},{"text":"2:05","nodeName":"TD","fontSize":9,"alignment":"right","style":["html-td","html-tr","html-tbody","html-table","table","table-condensed"]}],[{"text":"SRA","nodeName":"TD","fontSize":9,"style":["html-td","html-tr","html-tbody","html-table","table","table-condensed"]},{"text":"Stina Toftager Rasmussen","nodeName":"TD","fontSize":9,"style":["html-td","html-tr","html-tbody","html-table","table","table-condensed"]},{"text":"Associate, Advokat","nodeName":"TD","fontSize":9,"style":["html-td","html-tr","html-tbody","html-table","table","table-condensed"]},{"text":"3.650,00","nodeName":"TD","fontSize":9,"style":["html-td","html-tr","html-tbody","html-table","table","table-condensed"]},{"text":"2:00","nodeName":"TD","fontSize":9,"alignment":"right","style":["html-td","html-tr","html-tbody","html-table","table","table-condensed"]}],[{"text":"DSO","nodeName":"TD","fontSize":9,"style":["html-td","html-tr","html-tbody","html-table","table","table-condensed"]},{"text":"Daiga Grunte-Sonne","nodeName":"TD","fontSize":9,"style":["html-td","html-tr","html-tbody","html-table","table","table-condensed"]},{"text":"Director, advokat","nodeName":"TD","fontSize":9,"style":["html-td","html-tr","html-tbody","html-table","table","table-condensed"]},{"text":"3.900,00","nodeName":"TD","fontSize":9,"style":["html-td","html-tr","html-tbody","html-table","table","table-condensed"]},{"text":"0:10","nodeName":"TD","fontSize":9,"alignment":"right","style":["html-td","html-tr","html-tbody","html-table","table","table-condensed"]}],[{"text":"Total","nodeName":"TD","fontSize":9,"style":["html-td","html-tr","html-tbody","html-table","table","table-condensed"],"colSpan":4},{"text":""},{"text":""},{"text":""},{"text":"4:15","nodeName":"TD","fontSize":9,"alignment":"right","style":["html-td","html-tr","html-tbody","html-table","table","table-condensed"]}]],"widths":["10.5%","NaN%","NaN%","NaN%","10.5%"],"heights":["auto","auto","auto","auto","auto"]}}],"","",{"text":"","margin":[0,0,0,20]},"","",""],"defaultStyle":{"font":"Arial"},"styles":{"rightme":{"alignment":"right","margin":[0,2,0,40]},"article":{"margin":[0,2,0,1],"fontSize":9},"articlebottom":{"margin":[0,2,0,40],"fontSize":9},"extratext":{"margin":[0,5,0,1],"fontSize":9},"extratextRight":{"margin":[0,5,0,1],"fontSize":9,"alignment":"right"},"extratextDanskeBank":{"margin":[0,5,0,1],"fontSize":7},"extratextDanskeBankRight":{"margin":[0,5,0,1],"fontSize":7,"alignment":"right"},"extratextHeader":{"margin":[0,0,0,2],"fontSize":9,"bold":true},"extraTableHeader":{"margin":[0,0,0,2],"fontSize":9,"bold":true},"extraTableHeaderRight":{"margin":[0,0,0,2],"fontSize":9,"bold":true,"alignment":"right"},"extraTableHeaderDanskeBank":{"margin":[0,0,0,2],"fontSize":9,"bold":true},"extraTableHeaderDanskeBankRight":{"margin":[0,0,0,2],"fontSize":9,"bold":true,"alignment":"right"},"insertspace":{"margin":[0,30,0,0]},"tableHeader":{"margin":[0,0,0,2],"fontSize":9,"bold":true},"tableHeaderRight":{"margin":[0,0,0,2],"fontSize":9,"bold":true,"alignment":"right"},"tableBody":{"margin":[0,0,0,2],"fontSize":7},"tableBodyRight":{"margin":[0,0,0,2],"fontSize":7,"alignment":"right"},"tableRowRight":{"margin":[0,0,0,2],"alignment":"right"},"footerHeader":{"margin":[0,6,0,0],"fontSize":7,"bold":true}}}
The text was updated successfully, but these errors were encountered: