Can i create one table with center alignment (page) using PDFMAKE?
Already defined alignment: "center" in Styles and inside the tag table: {}
{
table: {
width: "auto",
body: [
[
{ text: "PERÍODO", style: "tableHeader" },
{ text: "VOLUME (MW médios)", style: "tableHeader" }
],
["{7} a {8}", "{9}"],
["{10} a {11}", "{12}"],
["{13} a {14}", "{15}"]
],
alignment: "center"
}
}
I expect one table align in the center of the page.
alignment:"center"
only aligns the content of the columns in center. You can try as following:
{
columns: [
{ width: '*', text: '' },
{
width: 'auto',
table: {
body: [
[
{ text: "PERÍODO", style: "tableHeader" },
{ text: "VOLUME (MW médios)", style: "tableHeader" }
],
["{7} a {8}", "{9}"],
["{10} a {11}", "{12}"],
["{13} a {14}", "{15}"]
],
alignment: "center"
}
},
{ width: '*', text: '' },
]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With