Print Multiple Table in One Pdf Document

Print Multiple Table in One Pdf Document

hcmhmthcmhmt Posts: 2Questions: 1Answers: 0

Is it possible to print multiple datatables in one pdf document. So that to have one Print button for all the tables on the page? Thanks!

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @hcmhmt ,

    This SO thread should help, it's asking the same thing.

    Cheers,

    Colin

  • hcmhmthcmhmt Posts: 2Questions: 1Answers: 0
    edited November 2021

    This is acceptible for tables which have same header. But my tables have different headers. My tables are below.

    var table1 = $('#list1').DataTable({
                            "ordering": false,
                            "searching": false,
                            "sorting": false,
                            "paging": false,
                            "bInfo": false,
                            ajax: {
                                url: source1,
                                dataSrc: ''"
                            },
                            columns: [
                                {
                                    data: 'fullName',
                                    title: 'Full Name'
                                }]
                        });
    
                        table2 = $('#list2').DataTable({
                            "scrollY": "72px",
                            "scrollCollapse": true,
                            "ordering": false,
                            "searching": false,
                            "sorting": false,
                            "paging": false,
                            "bInfo": false,
                            ajax: {
                                url: source2,
                                dataSrc: ''
                            },
                            columns: [
                                {
                                    data: 'wayName',
                                    title: 'Way Name'
                                },
                                {
                                    data: 'teams',
                                    title: 'Teams'
                                }]
                        });
    

    Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

  • aseverinomaseverinom Posts: 12Questions: 0Answers: 0

    hi @Colin the thread that you gave don't work with two tables with different header.. please your help. thanks a lot in advance,.

  • aseverinomaseverinom Posts: 12Questions: 0Answers: 0
    edited November 2021

    dear @hcmhmt did you find a solution ?, please your comments.

Sign In or Register to comment.