javascript - How to give option to print a bootstrap table? -
my question simple , limited , want print bootstrap table having id ("mytbl") how can make possible javascript / jquery ?(i dont want use plugins)
i newbie in using jquery , bootstrap please help
   <script>    $(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>' + $('#mytbl')[0].outerhtml + '</body></html>');             win.document.close();             win.print();             win.close();             return false;         });     });     </script>        <button class="btn  btn-default" type="submit">print item</button>      
Comments
Post a Comment