How can align only one column in pdfhtml5 export?
How can align only one column in pdfhtml5 export?
anguswild
Posts: 4Questions: 1Answers: 1
I have managed to edit the pdf export but i need to align only one column
i searched in this forum and in the pdfmake documentarion but i haven't find how to do it. Please help!
My customize function is the following
customize: function ( doc ) {
doc['footer']=(function(page, pages) {
return {
columns: [
'*',
{
alignment: 'right',
text: [
{ text: page.toString(), italics: true },
' de ',
{ text: pages.toString(), italics: true }
]
}
],
margin: [30, 0]
}
});
var d = new Date();
var fecha = d.toLocaleDateString('es-CL');
var hora = d.toLocaleTimeString('es-CL');
doc.content.splice( 1, 0, {
columns: [
{
alignment: 'left',
text: 'Comercial del Real \n Ramón Freire 471, Rancagua \n\n',
bold: true,
},
{
alignment: 'right',
text: 'Fecha: '+fecha+'\nHora: '+hora+' ',
margin: [ 0, 0, 40, 0 ],
bold: true
}
]
});
}
Can i do something like this?
doc.content[1].table.alignment = [ 'left', 'right', 'left' ];
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I honestly don't know myself. This is one for the pdfmake support channels rather than DataTables specific support.
Allan
i managed to do it this way, but only aligns the header
any idea in how can i do it for the entire column?
As I say, that's a pdfmake specific question.
I came up with a workaround
I don't know if it is the best solution but it worked for me
Have a nice day!