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

Table column widths with colspans involved #685

Closed
JohannesMunk opened this Issue Sep 12, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@JohannesMunk

JohannesMunk commented Sep 12, 2018

Hey WP-Team! This issue is low priority for us, as I have found a simple workaround. But nonetheless maybe you want to investigate or declare this as expected behaviour!

Whenever there is content in a cell with colspan the size of the colspan'ed element influences the width of the columns in an unexpected/unwanted way. On the left is chrome; on the right the output from WP.

test html pdf - adobe acrobat pro

It seems that while the layout is done the colspan is not taking into consideration. Giving WP a hint in terms of a style="width:1px" circumvents the issue.

<html>
<style>td {border: 1px solid black;}</style>
<body>
<div style="width:100%">
<table>
	<tr><td>A</td><td>B</td><td>C</td><td>D</td><td>E</td></tr>
	<tr>
		<td colspan='5'>Where does this go?</td>
	</tr>
</table>
<table>
	<tr><td>A</td><td>B</td><td>C</td><td>D</td><td>E</td></tr>
	<tr>
		<td colspan='5' style='width:1px' >Where does this go?</td>
	</tr>
</table>

</div>
</body>
</html>

What do you think?

@liZe liZe added the bug label Sep 13, 2018

@liZe

This comment has been minimized.

Member

liZe commented Sep 13, 2018

I don't know what's the worst part of this table between the first row and the second row. I'll have to go back deep in automatic table layout and add more tests!

(Just after fixing #666, it's really sad 😢.)

liZe added a commit that referenced this issue Sep 18, 2018

liZe added a commit that referenced this issue Sep 18, 2018

Add tests for tables
Related to #685.

@liZe liZe closed this in 6fdf578 Sep 19, 2018

@liZe liZe added this to the 43 milestone Sep 19, 2018

@liZe

This comment has been minimized.

Member

liZe commented Sep 19, 2018

We're getting closer and closer to what other web browsers do. There are some bugs left (I've even added a failing test), but the current implementation should be solid with more than 50 tests just for auto layout of tables.

OptikSage added a commit to OptikSage/WeasyPrint that referenced this issue Sep 20, 2018

OptikSage added a commit to OptikSage/WeasyPrint that referenced this issue Sep 20, 2018

OptikSage added a commit to OptikSage/WeasyPrint that referenced this issue Sep 20, 2018

Fix yet another auto table layout
True story: you can read and implement a quite complicated algorithm, use it
for years, and then get an issue related to this algorithm. You can fix the
code, carefully following the algorithm, but still get a bad rendering. Why?
Because the algorithm is wrong. Of course, as it's written by David Baron, it
can't be that wrong: there's actually a red ISSUE block telling that "The way
this describes distribution of widths from column-spanning cells is wrong" and
that I "should refer to the rules for distributing excess width to columns for
intrinsic width calculation".

I did. Guess what: it works.

Fix Kozea#685.
@JohannesMunk

This comment has been minimized.

JohannesMunk commented Sep 20, 2018

Most impressive work!
2018-09-21 00_10_55-wp-column-balance-orig html pdf - adobe acrobat pro
Thank you!

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Nov 14, 2018

py-weasyprint: Update to 43.
Version 43
----------

Released on 2018-11-09.

Bug fixes:

* `#726 <https://github.com/Kozea/WeasyPrint/issues/726>`_:
  Make empty strings clear previous values of named strings
* `#729 <https://github.com/Kozea/WeasyPrint/issues/729>`_:
  Include tools in packaging

This version also includes the changes from unstable rc1 and rc2 versions
listed below.

Version 43rc2
-------------

Released on 2018-11-02.

**This version is experimental, don't use it in production. If you find bugs,
please report them!**

Bug fixes:

* `#706 <https://github.com/Kozea/WeasyPrint/issues/706>`_:
  Fix text-indent at the beginning of a page
* `#687 <https://github.com/Kozea/WeasyPrint/issues/687>`_:
  Allow query strings in file:// URIs
* `#720 <https://github.com/Kozea/WeasyPrint/issues/720>`_:
  Optimize minimum size calculation of long inline elements
* `#717 <https://github.com/Kozea/WeasyPrint/issues/717>`_:
  Display <details> tags as blocks
* `#691 <https://github.com/Kozea/WeasyPrint/issues/691>`_:
  Don't recalculate max content widths when distributing extra space for tables
* `#722 <https://github.com/Kozea/WeasyPrint/issues/722>`_:
  Fix bookmarks and strings set on images
* `#723 <https://github.com/Kozea/WeasyPrint/issues/723>`_:
  Warn users when string() is not used in page margin


Version 43rc1
-------------

Released on 2018-10-15.

**This version is experimental, don't use it in production. If you find bugs,
please report them!**

Dependencies:

* Python 3.4+ is now needed, Python 2.x is not supported anymore
* Cairo 1.15.4+ is now needed, but 1.10+ should work with missing features
  (such as links, outlines and metadata)
* Pdfrw is not needed anymore

New features:

* `Beautiful website <https://weasyprint.org>`_
* `#579 <https://github.com/Kozea/WeasyPrint/issues/579>`_:
  Initial support of flexbox
* `#592 <https://github.com/Kozea/WeasyPrint/pull/592>`_:
  Support @font-face on Windows
* `#306 <https://github.com/Kozea/WeasyPrint/issues/306>`_:
  Add a timeout parameter to the URL fetcher functions
* `#594 <https://github.com/Kozea/WeasyPrint/pull/594>`_:
  Split tests using modern pytest features
* `#599 <https://github.com/Kozea/WeasyPrint/pull/599>`_:
  Make tests pass on Windows
* `#604 <https://github.com/Kozea/WeasyPrint/pull/604>`_:
  Handle target counters and target texts
* `#631 <https://github.com/Kozea/WeasyPrint/pull/631>`_:
  Enable counter-increment and counter-reset in page context
* `#622 <https://github.com/Kozea/WeasyPrint/issues/622>`_:
  Allow pathlib.Path objects for HTML, CSS and Attachment classes
* `#674 <https://github.com/Kozea/WeasyPrint/issues/674>`_:
  Add extensive installation instructions for Windows

Bug fixes:

* `#558 <https://github.com/Kozea/WeasyPrint/issues/558>`_:
  Fix attachments
* `#565 <https://github.com/Kozea/WeasyPrint/issues/565>`_,
  `#596 <https://github.com/Kozea/WeasyPrint/issues/596>`_,
  `#539 <https://github.com/Kozea/WeasyPrint/issues/539>`_:
  Fix many PDF rendering, printing and compatibility problems
* `#614 <https://github.com/Kozea/WeasyPrint/issues/614>`_:
  Avoid crashes and endless loops caused by a Pango bug
* `#662 <https://github.com/Kozea/WeasyPrint/pull/662>`_:
  Fix warnings and errors when generating documentation
* `#666 <https://github.com/Kozea/WeasyPrint/issues/666>`_,
  `#685 <https://github.com/Kozea/WeasyPrint/issues/685>`_:
  Fix many table layout rendering problems
* `#680 <https://github.com/Kozea/WeasyPrint/pull/680>`_:
  Don't crash when there's no font available
* `#662 <https://github.com/Kozea/WeasyPrint/pull/662>`_:
  Fix support of some align values in tables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment