Kozea / WeasyPrint

The awesome document factory
https://weasyprint.org
BSD 3-Clause "New" or "Revised" License
7.24k stars 686 forks source link

Right align in sample invoice #751

Open davidheijkamp opened 5 years ago

davidheijkamp commented 5 years ago

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.

liZe commented 5 years ago

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 commented 4 months ago

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>