We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Executing the following code snippet in live demo is expected to create a table that all its rows including the header center align.
center
var headers = [ {name: "id", align: "center", width: 100}, {name: "name", align: "center", width: 100} ]; var data = [ {id: "0", name: "Test 1"}, {id: "1", name: "Test 2"} ]; var doc = new jsPDF({ orientation: "landscape" }); doc.table(1, 1, data, headers);
But contrary to expectations, the header has been left align!
left
The problem seems to be from the bottom line:
https://github.com/MrRio/jsPDF/blob/704f5a9bbf30421a81f2cf33803904e0db0227f1/src/modules/cell.js#L429
Should be use headers instead of headerNames
headers
headerNames
headerAligns = headers.map(function(header) {
The text was updated successfully, but these errors were encountered:
Thanks for the report. Your suggested fix seems reasonable. Could you prepare a PR?
Sorry, something went wrong.
@mojtaba-khallash if your are using autotable then use this line of code headStyles: { halign: 'center'},
I'm aware of this plugin, but generating the table in this way now meets my needs.
Successfully merging a pull request may close this issue.
Executing the following code snippet in live demo is expected to create a table that all its rows including the header
center
align.But contrary to expectations, the header has been
left
align!The problem seems to be from the bottom line:
https://github.com/MrRio/jsPDF/blob/704f5a9bbf30421a81f2cf33803904e0db0227f1/src/modules/cell.js#L429
Should be use
headers
instead ofheaderNames
The text was updated successfully, but these errors were encountered: