WeasyPrint icon indicating copy to clipboard operation
WeasyPrint copied to clipboard

Right align in sample invoice

Open davidheijkamp opened this issue 7 years ago • 2 comments

In the sample invoice the invoice number doesn't correctly align to the right, like the rest of the content. This seems to be related to the PDF rendering by weasyprint, because the source HTML + CSS renders the text correctly.

davidheijkamp avatar Dec 09 '18 12:12 davidheijkamp

This seems to be related to the PDF rendering by weasyprint, because the source HTML + CSS renders the text correctly.

You're right. The space between the first dd and the second dt is included when calculating the dd's text position to align it right.

liZe avatar Dec 27 '18 13:12 liZe

Sample to reproduce:

<style>
  dl {
    text-align: right;
  }
  dt, dd {
    display: inline;
    margin: 0;
  }
  dt::before {
    content: '';
    display: block;
  }
</style>
<dl>
  <dt>Test</dt>
  <dd>12345</dd>
  <dt>Test</dt>
  <dd>12345</dd>
</dl>

liZe avatar Jul 11 '24 14:07 liZe