How can I center the columns in the PDF?
How can I center the columns in the PDF?
otavio_laskosk_pc
Posts: 21Questions: 6Answers: 0
I can't centralize the columns:
I've already put the command "alignment: 'center'" like this:
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5 ],
alignment: 'right',
}
but nothing change.
Anyone know hot to solve it?
This discussion has been closed.
Answers
Hi again,
That same thread, shows how to center the header - you can slip that same line ('alignment: 'center') into the table body sections.
Cheers,
Colin
Hi Colin,
Thank you by your reply,
According the tutorial you've passed, I added the command doc.defaultStyle.alignment = 'center' in the function customize: function(doc).
but it hasn't worked.
I changed the alignment: 'right' to alignment: 'center' too and nothing change.
You probably need to modify the
styles.tableHeader.alignment
property for the header cells, and similar for the other cells. See the pdfmake documentation for full details.Allan
Hi Allan,
Thank you by your reply,
I'm using the extend: 'pdfHtml5'
I put this command in the function customize: function ( doc )?
Take a look at the example here, it's using that thread to center the text.
Cheers,
Colin