Pdfmake: Positioning/aligning table to the right side of a page

Created on 16 Mar 2018  路  5Comments  路  Source: bpampuch/pdfmake

I need to align a table to the right side of a page, is this possible with pdfmake?

Most helpful comment

Table alignment is problematic because there is https://github.com/bpampuch/pdfmake/issues/72, but can be used workaround:

var dd = {
  content: [
        {
            columns: [
                { width: '*', text: '' },
                {
                    width: 'auto',
                        table: {
                                body: [
                                        ['Column 1', 'Column 2', 'Column 3'],
                                        ['One value goes here', 'Another one here', 'OK?']
                                ]
                        }
                }
            ]
        }
  ]
}

All 5 comments

Table alignment is problematic because there is https://github.com/bpampuch/pdfmake/issues/72, but can be used workaround:

var dd = {
  content: [
        {
            columns: [
                { width: '*', text: '' },
                {
                    width: 'auto',
                        table: {
                                body: [
                                        ['Column 1', 'Column 2', 'Column 3'],
                                        ['One value goes here', 'Another one here', 'OK?']
                                ]
                        }
                }
            ]
        }
  ]
}

Greate. Thank you for the workaround

Thank you, this worked for me.

Thank you, works!

Also you can use

     [  
        co1,
        {
          text: "right value",
          alignment: "right"
        },
        {
          text: "right value",
          alignment: "right"
        },
        {
          text: "right value",
          alignment: "right"
        }
      ]
Was this page helpful?
0 / 5 - 0 ratings

Related issues

kumarandena picture kumarandena  路  3Comments

m-brudi picture m-brudi  路  3Comments

einfallstoll picture einfallstoll  路  3Comments

CharlyPoppins picture CharlyPoppins  路  3Comments

kamilkp picture kamilkp  路  3Comments