Print CSS:
Css is the print stylesheet, and the media=”print” command means that this CSS file only gets called up when web pages are printed.
(There are many different media you can use for stylesheets, such as for handheld, projection etc.
@media print {
.redImgBefore {
page-break-before: always;
}
.redImg {
page-break-after: always;
}
}
@media print{
@page{size:A4, size:landscape or Portrait }
}
Note:International paper size ‘A4’, landscape orientation, is 297 mm wide x 210 mm long (11.69″ x 8.27″).
Styles in Print:
Print styles are named sets of print definition properties, such as scale, rotation, and color, that are used to create print sets in a consistent and automated manner.
@media print {
.page-break {
page-break-after: always;
}
.print-height-adjust {
-webkit-print-height-adjust: extract;
}
.print-color-adjust {
-webkit-print-color-adjust: extract;
}
}
Note:break-inside:avoid OR page-break-inside:avoid (In PDF this doesn’t work).
Note: Repeat Table Header and footer
<table>
<thead style="display: table-header-group">
</thead>
<tfoot style="display: table-footer-group">
</tfoot>
</table>
Note: Dont repear Table Header and footer
<table>
<thead style="display: table-row-group">
</thead>
<tfoot style="display: table-row-group">
</tfoot>
</table>
Last Update: July 10, 2026
Total 0 Votes:
0
0

