Print PDF does not have table borders

Print PDF does not have table borders

Tareq3rarTareq3rar Posts: 1Questions: 1Answers: 0

Hello all
i am using DataTable 1.10.12 and every thing works well except that when using print button the borders of the table does not display, even if i uses the customize attribute with some design it's not working.
here is the code that i use:

                    $('#ar_table_planned').DataTable({
                        columnDefs: [{
                            "visible": false,
                            targets: [3]
                        }],
                        aLengthMenu: [
                            [-1],
                            ["All"]
                        ],
                        iDisplayLength: -1,
                        "searching": false,
                        "ordering": false,
                        "dom": "<'row'<'col-md-12 col-sm-12'B>>",
                        buttons: [
                            {
                                extend: 'excelHtml5',
                                exportOptions: {
                                    columns: [1, 2, 3, 4, 5]
                                }
                            },
                            {
                                extend: 'print',

                                customize: function ( win ) {
                                    $(win.document.body)
                                        .css( 'font-size', '10pt' );

                                    $(win.document.body).find( 'table' )
                                        .addClass( 'compact' )
                                        .css( 'font-size', 'inherit' );
                                },
                                exportOptions: {
                                    columns: [1, 2, 3, 4, 5]
                                }
                        }
                        ]
                    });

Thank you in advance

This discussion has been closed.