Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tables overflowing page limits #727

Closed
RafaelLinux opened this issue Nov 6, 2018 · 10 comments

Comments

@RafaelLinux
Copy link

commented Nov 6, 2018

I'm not sure if is a previosly commented issue, but this is the case: Two distinct tables are overflowing page limits, one at bottom and the other one at right. In the screenshots, you can compare Firefox print preview output (left side) and weasyprint output (right side). I coded CSS to show on screen closer to print output, and on screen, the table overflowing at right is correctly displayed.

I'm using latest weasyprint and parameter "--presentational-hints"

This is the table overflowing at bottom:
weasyprint - table bottom overflow

This is the table overflowing at right:
weasyprint - table right overflow

weasyprint issues.zip

Any idea what's wrong?

Thank you

@liZe

This comment has been minimized.

Copy link
Member

commented Nov 6, 2018

Hello!

This is the table overflowing at bottom:

That's because we can't break pages in a table line. See #36.

This is the table overflowing at right:

That's a different issue. I have to check what's happening.

@liZe

This comment has been minimized.

Copy link
Member

commented Nov 6, 2018

I have to check what's happening.

There's a 'width="793"' attribute set to your table, looks like it's larger than the page.

So for me, there's nothing wrong in WeasyPrint (except for the first case corresponding to #36).

@liZe

This comment has been minimized.

Copy link
Member

commented Nov 6, 2018

(By the way: the page style is much better like this 😉)

@RafaelLinux

This comment has been minimized.

Copy link
Author

commented Nov 7, 2018

That's because we can't break pages in a table line. See #36.

So .... I'm in trouble. Despite page style "maybe" is better :P we have no control about the content of the table lines. Usually, tables have large cells that contains text, so we can't do nothing about it cause the format must be respected for legal reasons. That's a big inconvenient if we want to use Weasyprint ... I need to think if we can use a workaround cause we was betting for weasyprint as final solution to obtain PDFs :(

There's a 'width="793"' attribute set to your table, looks like it's larger than the page.

Unfortunately, that's a table property assigned by editors, but it's override as you can see, by CSS. As you can see on screen and when previewing the print, the tables are adjusted to they content, ignoring the width.

Thank you for your clarification

@liZe

This comment has been minimized.

Copy link
Member

commented Nov 7, 2018

Unfortunately, that's a table property assigned by editors, but it's override as you can see, by CSS.

Oh, I see. None of the values you set in CSS are supported by WeasyPrint (unset and fit-content). Adding width: auto before width: unset will work.

@RafaelLinux

This comment has been minimized.

Copy link
Author

commented Nov 7, 2018

I tried adding adding width: auto before width: unset has you suggested. It solves the right-side overflowing, but have ugly collateral effects over all the other tables in document. This is the comparison screenshot. At the left side is with the original CSS. At the right, with you suggestion:
weasyprint - table witdth after adding width auto before width unset solved overflow
But here, a piece of collateral effects on the other tables:
weasyprint - table width after adding width auto before width unset unwanted collateral effect

And while inspecting the effects on all the document, I discover accidentally something very worrying, not related with the CSS, but with weasyprint. Take a look at this screenshot:
weasyprint - table dissapeared between pages
As you can observe, a little table is dissapeared just when it's between pages. The html code for this table is simply:
<table cellspacing="0" cellpadding="0" border="1"><thead><tr><th id="th069E20400000" valign="top">Anexo IV<br>Contrato menor</th></tr></thead></table>
I'm afraid it's consequence of bug #36 , but not sure.

That bug is a stone in the road in our way to use weasyprint :( , cause we can not lost any word in our PDFs.

Thank you for the suggestion about the CSS.

@liladude

This comment has been minimized.

Copy link

commented Apr 26, 2019

Hello, I am here to report a similar related problem. I have tables with really long text on them, which is why I have put "td {page-break-inside: auto;}" in my css (even if this should be the standard). Unfortunately the table overflow my bottom margin... and it only happens with weasyprint (so far)!

@liZe

This comment has been minimized.

Copy link
Member

commented Jul 25, 2019

As you can observe, a little table is dissapeared just when it's between pages.

I'd really like to have a short HTML sample showing this problem, because I can't reproduce.

@liZe

This comment has been minimized.

Copy link
Member

commented Jul 25, 2019

Hello, I am here to report a similar related problem. I have tables with really long text on them, which is why I have put "td {page-break-inside: auto;}" in my css (even if this should be the standard). Unfortunately the table overflow my bottom margin... and it only happens with weasyprint (so far)!

This is what's reported by bug #36.

@liZe

This comment has been minimized.

Copy link
Member

commented Sep 16, 2019

That bug is a stone in the road in our way to use weasyprint :( , cause we can not lost any word in our PDFs.

We've greatly improved the way tables are rendered between pages in #941. #36 is not fixed yet, but we can now use break-* rules for tbody and tr, and we don't lose tables anymore.

I think that I can close this issue, as:

  • we don't break tds, but that's what #36 tracks,
  • we're able to correctly break between trs and tbodys, even respecting break-* rules,
  • we don't "forget" lines anymore.

Feel free to reopen if there's anything I didn't think of!

@liZe liZe closed this Sep 16, 2019
@liZe liZe added this to the 50 milestone Sep 16, 2019
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Oct 9, 2019
Version 50
----------

Released on 2019-09-19.

New features:

* `#209 <https://github.com/Kozea/WeasyPrint/issues/209>`_:
  Make ``break-*`` properties work inside tables
* `#661 <https://github.com/Kozea/WeasyPrint/issues/661>`_:
  Make blocks with ``overflow: auto`` grow to include floating children

Bug fixes:

* `#945 <https://github.com/Kozea/WeasyPrint/issues/945>`_:
  Don't break pages between a list item and its marker
* `#727 <https://github.com/Kozea/WeasyPrint/issues/727>`_:
  Avoid tables lost between pages
* `#831 <https://github.com/Kozea/WeasyPrint/issues/831>`_:
  Ignore auto margins on flex containers
* `#923 <https://github.com/Kozea/WeasyPrint/issues/923>`_:
  Fix a couple of crashes when splitting a line twice
* `#896 <https://github.com/Kozea/WeasyPrint/issues/896>`_:
  Fix skip stack order when using a reverse flex direction

Contributors:

- grewn0uille
- Guillaume Ayoub

Version 49
----------

Released on 2019-09-11.

Performance:

* Speed and memory use have been largely improved.

New features:

* `#700 <https://github.com/Kozea/WeasyPrint/issues/700>`_:
  Handle ``::marker`` pseudo-selector
* `135dc06c <https://github.com/Kozea/WeasyPrint/commit/135dc06c>`_:
  Handle ``recto`` and ``verso`` parameters for page breaks
* `#907 <https://github.com/Kozea/WeasyPrint/pull/907>`_:
  Provide a clean way to build layout contexts

Bug fixes:

* `#937 <https://github.com/Kozea/WeasyPrint/issues/937>`_:
  Fix rendering of tables with empty lines and rowspans
* `#897 <https://github.com/Kozea/WeasyPrint/issues/897>`_:
  Don't crash when small columns are wrapped in absolute blocks
* `#913 <https://github.com/Kozea/WeasyPrint/issues/913>`_:
  Fix a test about gradient colors
* `#924 <https://github.com/Kozea/WeasyPrint/pull/924>`_:
  Fix title for document with attachments
* `#917 <https://github.com/Kozea/WeasyPrint/issues/917>`_:
  Fix tests with Pango 1.44
* `#919 <https://github.com/Kozea/WeasyPrint/issues/919>`_:
  Fix padding and margin management for column flex boxes
* `#901 <https://github.com/Kozea/WeasyPrint/issues/901>`_:
  Fix width of replaced boxes with no intrinsic width
* `#906 <https://github.com/Kozea/WeasyPrint/issues/906>`_:
  Don't respect table cell width when content doesn't fit
* `#927 <https://github.com/Kozea/WeasyPrint/pull/927>`_:
  Don't use deprecated ``logger.warn`` anymore
* `a8662794 <https://github.com/Kozea/WeasyPrint/commit/a8662794>`_:
  Fix margin collapsing between caption and table wrapper
* `87d9e84f <https://github.com/Kozea/WeasyPrint/commit/87d9e84f>`_:
  Avoid infinite loops when rendering columns
* `789b80e6 <https://github.com/Kozea/WeasyPrint/commit/789b80e6>`_:
  Only use in flow children to set columns height
* `615e298a <https://github.com/Kozea/WeasyPrint/commit/615e298a>`_:
  Don't include floating elements each time we try to render a column
* `48d8632e <https://github.com/Kozea/WeasyPrint/commit/48d8632e>`_:
  Avoid not in flow children to compute column height
* `e7c452ce <https://github.com/Kozea/WeasyPrint/commit/e7c452ce>`_:
  Fix collapsing margins for columns
* `fb0887cf <https://github.com/Kozea/WeasyPrint/commit/fb0887cf>`_:
  Fix crash when using currentColor in gradients
* `f66df067 <https://github.com/Kozea/WeasyPrint/commit/f66df067>`_:
  Don't crash when using ex units in word-spacing in letter-spacing
* `c790ff20 <https://github.com/Kozea/WeasyPrint/commit/c790ff20>`_:
  Don't crash when properties needing base URL use var functions
* `d63eac31 <https://github.com/Kozea/WeasyPrint/commit/d63eac31>`_:
  Don't crash with object-fit: non images with no intrinsic size

Documentation:

* `#900 <https://github.com/Kozea/WeasyPrint/issues/900>`_:
  Add documentation about semantic versioning
* `#692 <https://github.com/Kozea/WeasyPrint/issues/692>`_:
  Add a snippet about PDF magnification
* `#899 <https://github.com/Kozea/WeasyPrint/pull/899>`_:
  Add .NET wrapper link
* `#893 <https://github.com/Kozea/WeasyPrint/pull/893>`_:
  Fixed wrong nested list comprehension example
* `#902 <https://github.com/Kozea/WeasyPrint/pull/902>`_:
  Add ``state`` to the ``make_bookmark_tree`` documentation
* `#921 <https://github.com/Kozea/WeasyPrint/pull/921>`_:
  Fix typos in the documentation
* `#328 <https://github.com/Kozea/WeasyPrint/issues/328>`_:
  Add CSS sample for forms

Contributors:

- grewn0uille
- Guillaume Ayoub
- Raphael Gaschignard
- Stani
- Szmen
- Thomas Dexter
- Tontyna

Version 48
----------

Released on 2019-07-08.

Dependencies:

* CairoSVG 2.4.0+ is now needed

New features:

* `#891 <https://github.com/Kozea/WeasyPrint/pull/891>`_:
  Handle ``text-overflow``
* `#878 <https://github.com/Kozea/WeasyPrint/pull/878>`_:
  Handle ``column-span``
* `#855 <https://github.com/Kozea/WeasyPrint/pull/855>`_:
  Handle all the ``text-decoration`` features
* `#238 <https://github.com/Kozea/WeasyPrint/issues/238>`_:
  Don't repeat background images when it's not needed
* `#875 <https://github.com/Kozea/WeasyPrint/issues/875>`_:
  Handle ``object-fit`` and ``object-position``
* `#870 <https://github.com/Kozea/WeasyPrint/issues/870>`_:
  Handle ``bookmark-state``

Bug fixes:

* `#686 <https://github.com/Kozea/WeasyPrint/issues/686>`_:
  Fix column balance when children are not inline
* `#885 <https://github.com/Kozea/WeasyPrint/issues/885>`_:
  Actually use the content box to resolve flex items percentages
* `#867 <https://github.com/Kozea/WeasyPrint/issues/867>`_:
  Fix rendering of KaTeX output, including (1) set row baseline of tables when
  no cells are baseline-aligned, (2) set baseline for inline tables, (3) don't
  align lines larger than their parents, (4) force CairoSVG to respect image
  size defined by CSS.
* `#873 <https://github.com/Kozea/WeasyPrint/issues/873>`_:
  Set a minimum height for empty list elements with outside marker
* `#811 <https://github.com/Kozea/WeasyPrint/issues/811>`_:
  Don't use translations to align flex items
* `#851 <https://github.com/Kozea/WeasyPrint/issues/851>`_,
  `#860 <https://github.com/Kozea/WeasyPrint/issues/860>`_:
  Don't cut pages when content overflows a very little bit
* `#862 <https://github.com/Kozea/WeasyPrint/issues/862>`_:
  Don't crash when using UTC dates in metadata

Documentation:

* `#854 <https://github.com/Kozea/WeasyPrint/issues/854>`_:
  Add a "Tips & Tricks" section

Contributors:

- Gabriel Corona
- Guillaume Ayoub
- Manuel Barkhau
- Nathan de Maestri
- grewn0uille
- theopeek

Version 47
----------

Released on 2019-04-12.

New features:

* `#843 <https://github.com/Kozea/WeasyPrint/pull/843>`_:
  Handle CSS variables
* `#846 <https://github.com/Kozea/WeasyPrint/pull/846>`_:
  Handle ``:nth()`` page selector
* `#847 <https://github.com/Kozea/WeasyPrint/pull/847>`_:
  Allow users to use a custom SSL context for HTTP requests

Bug fixes:

* `#797 <https://github.com/Kozea/WeasyPrint/issues/797>`_:
  Fix underlined justified text
* `#836 <https://github.com/Kozea/WeasyPrint/issues/836>`_:
  Fix crash when flex items are replaced boxes
* `#835 <https://github.com/Kozea/WeasyPrint/issues/835>`_:
  Fix ``margin-break: auto``

Version 46
----------

Released on 2019-03-20.

New features:

* `#771 <https://github.com/Kozea/WeasyPrint/issues/771>`_:
  Handle ``box-decoration-break``
* `#115 <https://github.com/Kozea/WeasyPrint/issues/115>`_:
  Handle ``margin-break``
* `#821 <https://github.com/Kozea/WeasyPrint/issues/821>`_:
  Continuous integration includes tests on Windows

Bug fixes:

* `#765 <https://github.com/Kozea/WeasyPrint/issues/765>`_,
  `#754 <https://github.com/Kozea/WeasyPrint/issues/754>`_,
  `#800 <https://github.com/Kozea/WeasyPrint/issues/800>`_:
  Fix many crashes related to the flex layout
* `#783 <https://github.com/Kozea/WeasyPrint/issues/783>`_:
  Fix a couple of crashes with strange texts
* `#827 <https://github.com/Kozea/WeasyPrint/pull/827>`_:
  Named strings and counters are case-sensitive
* `#823 <https://github.com/Kozea/WeasyPrint/pull/823>`_:
  Shrink min/max-height/width according to box-sizing
* `#728 <https://github.com/Kozea/WeasyPrint/issues/728>`_,
  `#171 <https://github.com/Kozea/WeasyPrint/issues/171>`_:
  Don't crash when fixed boxes are nested
* `#610 <https://github.com/Kozea/WeasyPrint/issues/610>`_,
  `#828 <https://github.com/Kozea/WeasyPrint/issues/828>`_:
  Don't crash when preformatted text lines end with a space
* `#808 <https://github.com/Kozea/WeasyPrint/issues/808>`_,
  `#387 <https://github.com/Kozea/WeasyPrint/issues/387>`_:
  Fix position of some images
* `#813 <https://github.com/Kozea/WeasyPrint/issues/813>`_:
  Don't crash when long preformatted text lines end with ``\n``

Documentation:

* `#815 <https://github.com/Kozea/WeasyPrint/pull/815>`_:
  Add documentation about custom ``url_fetcher``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.