table print js problem

Asked

Viewed 44 times

1

Look I have a problem in this code the table does not appear in print

$(function () {
        $('button[type="submit"]').click(function () {
            var pageTitle = 'Page Title',
                stylesheet = '//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css',
                win = window.open('', 'Print', 'width=500,height=300');
            win.document.write('<html><head><title>' + pageTitle + '</title>' +
                '<link rel="stylesheet" href="' + stylesheet + '">' +
                '</head><body><table class="footable table table-stripped default no-paging footable-loaded" data-page-size="8" data-filter="#filter">'+
                                 '<thead><tr><th class="footable-visible footable-first-column footable-sortable">idVenda<span class="footable-sort-indicator"></span></th><th class="footable-visible footable-sortable">Cliente<span class="footable-sort-indicator"></span></th><th data-hide="phone,tablet" class="footable-visible footable-sortable">Vendedor<span class="footable-sort-indicator"></span></th><th data-hide="phone,tablet" class="footable-visible footable-sortable">Igreja<span class="footable-sort-indicator"></span></th><th data-hide="phone,tablet" class="footable-visible footable-sortable">Coordena<span class="footable-sort-indicator"></span></th><th data-hide="phone,tablet" class="footable-visible footable-sortable">Valor<span class="footable-sort-indicator"></span></th><th data-hide="phone,tablet" class="footable-visible footable-sortable">QTD Parcela<span class="footable-sort-indicator"></span></th><th data-hide="phone,tablet" class="footable-visible footable-last-column footable-sortable">Parcelas<span class="footable-sort-indicator"></span></th></tr></thead><tbody><tr class="gradeX footable-even" style="display: table-row;"><td class="footable-visible footable-first-column"><span class="footable-toggle"></span>8</td><td class="footable-visible">George</td><td class="footable-visible">8</td><td class="footable-visible">7</td><td class="footable-visible">6</td><td class="footable-visible">12000</td><td class="footable-visible">6</td>  <td class="footable-visible footable-last-column">'+
                                '<button class="parcelasGerar btn btn-info btn-rounded">Gerar</button>'+
									'<button class="parcelasVizualizar btn btn-success btn-rounded">Visualizar</button>'+
                            '</td></tr><tr class="gradeX footable-odd" style="display: table-row;"><td class="footable-visible footable-first-column"><span class="footable-toggle"></span>9</td><td class="footable-visible">paulo</td><td class="footable-visible">8</td><td class="footable-visible">7</td><td class="footable-visible">6</td><td class="footable-visible">30</td><td class="footable-visible">2</td>  <td class="footable-visible footable-last-column">'+
                                '<button class="parcelasGerar btn btn-info btn-rounded">Gerar</button>'+
                                '<button class="parcelasVizualizar btn btn-success btn-rounded">Visualizar</button>'+
                            '</td></tr><tr class="gradeX footable-even" style="display: table-row;"><td class="footable-visible footable-first-column"><span class="footable-toggle"></span>10</td><td class="footable-visible">wqwq</td><td class="footable-visible">8</td><td class="footable-visible">7</td><td class="footable-visible">6</td><td class="footable-visible">12000</td><td class="footable-visible">3</td>  <td class="footable-visible footable-last-column">'+
                                '<button class="parcelasGerar btn btn-info btn-rounded">Gerar</button>'+
                                '<button class="parcelasVizualizar btn btn-success btn-rounded">Visualizar</button>'+
                            '</td></tr></tbody>                                <tfoot>'+
                                '<tr>'+
                                    '<td colspan="5" class="footable-visible">'+
                                        '<ul class="pagination pull-right"><li class="footable-page-arrow disabled"><a data-page="first" href="#first">«</a></li><li class="footable-page-arrow disabled"><a data-page="prev" href="#prev">‹</a></li><li class="footable-page active"><a data-page="0" href="#">1</a></li><li class="footable-page-arrow disabled"><a data-page="next" href="#next">›</a></li><li class="footable-page-arrow disabled"><a data-page="last" href="#last">»</a></li></ul>'+
                                    '</td>'+
                                '</tr>'+
                                '</tfoot>'+
                            '</table></body></html>');
            win.document.close();
            win.print();
            win.close();
            return false;
        });
    });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<button class="btn  btn-default" type="submit">Print Item</button>

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.