Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Improve Table Printing #344

Merged
merged 2 commits into from
Nov 22, 2012
Merged

Improve Table Printing #344

merged 2 commits into from
Nov 22, 2012

Conversation

milianw
Copy link
Contributor

@milianw milianw commented Nov 22, 2012

Reapply the two table-printing related patches of #211 which apparently got lost when the Qt source tree was imported.

This solves the following two issues:

http://code.google.com/p/phantomjs/issues/detail?id=880
http://code.google.com/p/phantomjs/issues/detail?id=615

Example html page:

https://userpage.physik.fu-berlin.de/~milianw/phantomjs/printing/longtable.html

Example PDF output without patches:
https://userpage.physik.fu-berlin.de/~milianw/phantomjs/printing/longtable_vanilla.pdf

Example PDF output with both patches:
https://userpage.physik.fu-berlin.de/~milianw/phantomjs/printing/longtable_patched.pdf

Note: PDF output was created using the following command:

phantomjs examples/rasterize.js \
http://userpage.physik.fu-berlin.de/~milianw/phantomjs/printing/longtable.html \
longtable_patched.pdf A4

This was part of a previous PhantomJS release but got reverted
when the Qt source tree was imported. See the old pull request
here: #211

http://code.google.com/p/phantomjs/issues/detail?id=880
This was already done in #211
but somehow got lost when the Qt source tree was imported.

Note that I even improved this patch a bit to also properly repaint
the borders of cells in thead/tfoot.

http://code.google.com/p/phantomjs/issues/detail?id=615
@ariya
Copy link
Owner

ariya commented Nov 22, 2012

Good catch, thank you!

@ariya ariya merged commit 2d778f6 into ariya:master Nov 22, 2012
@skotchio
Copy link

That pull request doesn't work if td has rowspan. something like this: http://jsfiddle.net/YJtg8/

@dpix
Copy link

dpix commented Aug 12, 2013

This issue appears to be fixed in release 1.8 but broken again in 1.9 :(

@Spaceghost
Copy link

@dpix, is this issue still broken in phantomjs 1.9.2?

@skotchio
Copy link

@dpix unfortunately it's still broken :(

ariya pushed a commit that referenced this pull request Jan 7, 2014
This patch is taken from https://bugs.webkit.org/show_bug.cgi?id=5097#c17

It was originally part of PR #211 but was possibly overlooked in PR #344
(when the other two patches got reapplied after the QT source import).
@k31Sh1n
Copy link

k31Sh1n commented Jan 26, 2014

@ariya , @milianw : This bug is still broken. Please fix.

@ariya
Copy link
Owner

ariya commented Jan 26, 2014

@k31Sh1n The report is appreciated. Please help further.

@subyraman
Copy link

@ariya, @milianw: since this is broken, is there a way to disable repeating theads/tfoots? I don't need repeating for my project. Thank you.

@aidanlister
Copy link

There's test-cases to reproduce bad thead positioning in this issue:
#10989

@dominikra
Copy link

Unfortunately problem still present.

trygveaa added a commit to trygveaa/phantomjs that referenced this pull request Jun 16, 2015
This has been done a few times before[0][1], but seems to be broken
again as reported in [2].

This commit is only reinstating what's missing from [1]. This was done
by running:

    git log -p -1 2d778f6 | git apply -3 -p6 --directory=src/qt/qtwebkit

And resolving the conflicts. There are still some compile errors. These
will be fixed in the upcoming commits instead of in this one to clarify
the changes.

This change doesn't completely fix the issue. The thead/tfoot block is
drawn again on the next page, however the other content is not shifted
down accordingly. This means that the thead/tfoot block on the next page
will be placed on top of the continued table instead of above it.

[0]: ariya#211
[1]: ariya#344
[2]: ariya#13324
trygveaa added a commit to trygveaa/phantomjs that referenced this pull request Jun 16, 2015
This has been done a few times before[0][1], but seems to be broken
again as reported in [2].

This commit is only reinstating what's missing from [1]. This was done
by running:

    git log -p -1 2d778f6 | git apply -3 -p6 --directory=src/qt/qtwebkit

And resolving the conflicts. There are still some compile errors. These
will be fixed in the upcoming commits instead of in this one to clarify
the changes.

This change doesn't completely fix the issue. The thead block is drawn
again on the next page, however the other content is not shifted down
accordingly. This means that the thead block on the next page will be
placed on top of the continued table instead of above it. The tfoot
block is also repeated and seems to work as expected.

[0]: ariya#211
[1]: ariya#344
[2]: ariya#13324
trygveaa added a commit to trygveaa/phantomjs that referenced this pull request Jun 16, 2015
This has been done a few times before[0][1], but seems to be broken
again as reported in [2].

This commit is only reinstating what's missing from [1]. This was done
by running:

    git log -p -1 2d778f6 | git apply -3 -p6 --directory=src/qt/qtwebkit

And resolving the conflicts. There are still some compile errors. These
will be fixed in the upcoming commits instead of in this one to clarify
the changes.

[0]: ariya#211
[1]: ariya#344
[2]: ariya#13324
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants