Welcome Guest Search | Active Topics | Sign In | Register

side by side tables using float left/right don't display correctly on second page of PDF Options
Gary Manninen
Posted: Thursday, August 15, 2019 7:39:55 PM
Rank: Newbie
Groups: Member

Joined: 3/6/2015
Posts: 1
I tried searching the support forum and couldn't find anything similar. Either I was using the wrong search terms or this hasn't been identified as an issue before.

I am converting an HTML report to PDF and on the report I have a div with two tables side by side with one floated left and one floated right. The table on the left has table headers that should repeat on each page if it extends beyond one page. The table on the right does not have table headers and should never extend beyond one page as it has a fixed length.

Rough pseudo code: (missing some details, but this should give the idea of the setup)

<div style="width:100%>
<table style="float:left; page-break-inside:avoid; table-layout: fixed; width:55%;">
<colgroup>
-- 9 column width definitions
</colgroup>

<thead>
-- 9 column header definitions
</thead>

-- many rows of data (enough to fill beyond one page)

</table>

<table style="float:right; page-break-inside:avoid; table-layout: fixed; width:44%;">
<colgroup>
-- 3 column width definitions
</colgroup>

-- fixed amount of data rows with no table header as each row is unique (fills roughly 2/3 of page)

</table>
</div>


When viewed in HTML:
Everything displays correctly regardless of the amount of data.


When converted to PDF:
Condition A) Both tables contain less than one page of data.

Everything converts correctly.


Condition B) The table on the left contains more than one page of data and table on the right does not.

What is converted is as follows:

Page 1:
The PDF looks correct as the table on the left fills the whole page and the table on the right displays all of its data (ending well before the bottom of the page).

Page 2:
The table on the left repeats its table header like it should and displays its remaining data correctly. However, part of the table on the right is displayed on page 2 and the size appears to be equal in height to the table header size of the table on the left. The table on the right is also cutoff mid-cell.

The issue that table on the right does not even have table headers and there isn't enough data to get to page two so the table on the right shouldn't be displayed at all on page 2 and I can't figure out how to make it disappear on page 2 (and I assuming beyond as well).


I have tried defining all data rows for the table on the right as part of <tbody> or defining an empty <thead> first, but nothing seems to change.

As I know we are running an older version, I tried downloading the most recent version first (19.2.30.0) to see if the problem was already fixed, but I ran into the same problem. Unfortunately, the newer version appears to have other conversion issues I will need to deal with that the older version did not have, but I'll worry about those once I determine what to do about this issue.

Please advise.


I can provide HTML and PDF examples if needed.
eo_support
Posted: Wednesday, August 21, 2019 10:23:33 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
Hi,

Sorry about the delay because of problems with the forum. Can you send a test HTML file to us? See here for details on sending test files to us:

https://www.essentialobjects.com/forum/test_project.aspx

Thanks!
eo_support
Posted: Wednesday, August 21, 2019 10:28:24 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
Hi,

Please ignore the previous reply. We have received your test files and we are looking into it. We will reply here again as soon as we have any update.

Thanks!
eo_support
Posted: Wednesday, August 21, 2019 4:48:44 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
Hi,

We looked into this issue. This looks strange on first glance but in fact is normal.

The key fact that caused this problem is paging does not change layout (these are two separate stages during the rendering process). So if you have two line of text in a left to right fashion in the same line like this in your HTML:

left right

Then no matter what happens during paging, the layout relationship between these two text segment will not change. This is obviously if such layout is achieved by "normal" means such as a table:

Code: HTML/ASPX
<table>
    <tr>
        <td>
                left
        </td>
        <td>
                right
        </td>
    <tr>
</table>


However it does not matter how you achieve this layout. This layout will not be changed by the paging process.

In your case, in the original "unpaged" HTML (what you see in a browser window), the table header of the left table and the first row of the right table are in the same horizontal level. So this relationship will NOT change during paging. This is why when the table header of the left table appears on the second page, whatever that was on the right side of the table header will also appear on the right side on that page.

To resolve this issue, you must change your layout because it is not possible to just repeat the left side without also repeating the right side. So you may want to modify your left/right column structure. Or you can put your right column as a column of the left table --- you still won't be able to align the top of the two this way though.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.