Pdfmake: Horizontal line?

Created on 15 Feb 2016  路  2Comments  路  Source: bpampuch/pdfmake

Hope it's ok to create an issue about this. I tried to search the documents but I might have missed how to create a horizontal line?

Most helpful comment

You only can solve this with a workaround.

  • use an Image containing a line
  • Create a table with layout headeronly you must define an empty body, otherwise the line would not appear:
var dd = {
    content: [
        {
                                  table : {
                                      headerRows : 1,
                                      widths: [200],
                                      body : [
                                              [''],
                                              ['']
                                              ]
                                  },
                                  layout : 'headerLineOnly'
                              }
            ]
}

The width defines the length of the line

Code tested in Playgorund.

All 2 comments

You only can solve this with a workaround.

  • use an Image containing a line
  • Create a table with layout headeronly you must define an empty body, otherwise the line would not appear:
var dd = {
    content: [
        {
                                  table : {
                                      headerRows : 1,
                                      widths: [200],
                                      body : [
                                              [''],
                                              ['']
                                              ]
                                  },
                                  layout : 'headerLineOnly'
                              }
            ]
}

The width defines the length of the line

Code tested in Playgorund.

Thanks! Works like a charm ;) Workaround works ;)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amnedge picture amnedge  路  30Comments

ghost picture ghost  路  33Comments

mpsbhat picture mpsbhat  路  34Comments

jakubsadura picture jakubsadura  路  43Comments

Dannybrown2710 picture Dannybrown2710  路  33Comments