How to print html table without unwanted button and th -


enter image description here

hi im having above table in html.i want print table using browser prompt. prompt coming right,but button on table showing in print preview..how can remove unwanted th , buttons.

var html = "<html>";         html += '<style>table, td, th {border:1px; solid black;} td{ textalign:center;}</style>';         html += '<div style=" border : 3px solid gray ;"><h3 style="vertical-align: middle; text-align: center;" align="center"><u>student academic details</u></h3>'                 + document.getelementbyid("studentacademicgriddiv").innerhtml                 + '</div>';         html += "</html>";          var printwin = window                 .open('', '',                         'left=0,top=0,width=800,height=600,toolbar=0,scrollbars=0,status  =0');          printwin.document.write(html);         printwin.document.close();         printwin.focus();         printwin.print();         printwin.close(); 

i tried above code printing.

add class th , button this: class="no-print"

and add css:

<style media="print"> .no-print { display: none; } <style> 

i hope helped you!


Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -