Print Format: PDF different than 'print'?

I have a custom print format that I’ve created. Part of it includes a table. The table appears different when clicking the ‘PDF’ button versus when clicking ‘Print’


Notice how in the second photo (the PDF view one) the top blue bar doesn’t extend all the way to the edge and there is an extra bit of space to the left of the items.

Yes, they are different. The source HTML is the same, but the renderer is different.

When you click “Print”, the source is rendered by whatever browser you are using. When you click “PDF”, the PDF is generated by a backend library. These backend libraries are sometimes very frustrating, and Frappe has slowly been shifting from wkhtmltopdf to weasyprint for this work. Both have many quirks.

Try to apply the style in

@media print {
.print-format {
font-size: 18px;
margin-top: 10mm;
margin-left: 10mm;
margin-right: 10mm;
font-size: 12px;
}
}
.print-format {

font-size: 18px;
}

Can you share the code specifically related to table.