Using php I created dynamical table, which contains all students from my database. I would like now to add an icon of printer, and when user clicks on that icon, to send this table to printer? I saw it on many pages, but how it's done? Tnx in advance...
Simply use window.print().
Example in jQuery:
<script>
$(function() {
$("#print").click(function() {
window.print();
});
});
</script>
<a id='print'>Print ME</a>
Example in JavaScript:
<script>
function printMe() {
window.print()
}
</script>
<input type="button" value="Print" onclick="printMe()">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With