Add print styles to base template to fix unwanted CSS/HTML output during printing

parent 58f3762b
......@@ -322,8 +322,93 @@
.text-end {
text-align: right;
}
/* Print styles */
@media print {
.header, .nav, .alert, .btn,
.btn-group, .dropdown-menu,
.pagination, .per-page-selector {
display: none !important;
}
body {
padding: 0 !important;
margin: 0 !important;
background: white !important;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
.container {
max-width: 100% !important;
padding: 0 !important;
margin: 0 !important;
}
.content {
background: white !important;
box-shadow: none !important;
border: 1px solid #ddd !important;
}
.table {
page-break-inside: auto;
}
tr {
page-break-inside: avoid;
}
.text-end {
text-align: left !important;
}
}
{% block extra_css %}{% endblock %}
</style>
<!-- Print Styles -->
<style>
@media print {
.header, .nav, .alert, .btn,
.btn-group, .dropdown-menu,
.pagination, .per-page-selector {
display: none !important;
}
body {
padding: 0 !important;
margin: 0 !important;
background: white !important;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
.container {
max-width: 100% !important;
padding: 0 !important;
margin: 0 !important;
}
.content {
background: white !important;
box-shadow: none !important;
border: 1px solid #ddd !important;
}
.table {
page-break-inside: auto;
}
tr {
page-break-inside: avoid;
}
.text-end {
text-align: left !important;
}
}
</style>
</style>
</head>
<body>
<div class="header">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment