Created
December 31, 2019 14:49
-
-
Save yakubu234/ad414d2f09a72d30707c232d48e18a9e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>a gist by yakubu abiola on html print part page </title> | |
<style media="screen"> | |
.noPrint{ display: block; } | |
.yesPrint{ display: block !important; } | |
</style> | |
<style media="print"> | |
.noPrint{ display: none; } | |
.yesPrint{ display: block !important; } | |
</style> | |
</head> | |
<body> | |
<div> | |
<p>this part here will not be printed </p> | |
<!-- this part above will not be printed --> | |
<div class= "yesPrint"> | |
<!-- the entire data in this div will be printed --> | |
<table border="1"> | |
<tr> | |
<th>Header 1</th> | |
<th>Header 2</th> | |
</tr> | |
<tr> | |
<td>row 1, cell 1</td> | |
<td>row 1, cell 2</td> | |
</tr> | |
<tr> | |
<td>row 2, cell 1</td> | |
<td>row 2, cell 2</td> | |
</tr> | |
</table> | |
</div> | |
<-- the print ends here --> | |
<!-- the button to print will be here immediately after the div to be printed , so as not to print the button along with it --> | |
<input TYPE="button" onClick="window.print()"> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment