Pdfmake: Customization of table borders

Created on 13 Jun 2018  路  1Comment  路  Source: bpampuch/pdfmake

Is there anyway to set table border colour and opacity?

Most helpful comment

Use custom hLineColor & vLineColor functions in the layout definition. There is an example in the "Tables" tab in the playground:

{
    table {
        (table definition)
    }, 
    layout: {
        fillColor: function (i, node) {
            return (i % 2 === 0)) ? '#fafafe' : null;
        },
        hLineColor: function (i, node) {
            return (i === 0 || i === node.table.body.length) ? 'black' : 'gray';
        },
        vLineColor: function(i, node) {
            return (i === 0 || i === node.table.widths.length) ? 'black' : 'gray';
        }

    }
}

>All comments

Use custom hLineColor & vLineColor functions in the layout definition. There is an example in the "Tables" tab in the playground:

{
    table {
        (table definition)
    }, 
    layout: {
        fillColor: function (i, node) {
            return (i % 2 === 0)) ? '#fafafe' : null;
        },
        hLineColor: function (i, node) {
            return (i === 0 || i === node.table.body.length) ? 'black' : 'gray';
        },
        vLineColor: function(i, node) {
            return (i === 0 || i === node.table.widths.length) ? 'black' : 'gray';
        }

    }
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ValeSauer picture ValeSauer  路  3Comments

CharlyPoppins picture CharlyPoppins  路  3Comments

kumarandena picture kumarandena  路  3Comments

davidyeiser picture davidyeiser  路  3Comments

imoum007 picture imoum007  路  3Comments