Forum


Replies: 5   Views: 4108
Nested table display error when converting to pdf
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by iftec_maxime  · 27-05-2015 - 08:17

Hello, I have a similar issue in nested tables when converting my document to ".pdf" or ".odt" (it works well in ".docx"). Widths values of the table colums are reset to equals values (the entire row width divided by the number of columns in this row). When there's two columns, each colums takes 50% of the entire width. When there's three columns, each colums takes 33% of the entire width, etc. I'm using Corporate version of Phpdocx 4.5 and LibreOffice plugin (4.3.7.2 version) for conversion. Each width are previously set for each column in the HTML code, so I don't undestand where this problem could come from. Widths are configured in percentage but when I convert them in pixels it doesn't change anything. Are you aware of this issue? Do you reproduce it ? Thank you. Here is an example of my HTML code: [body style="padding: 15mm; width: 180mm;"] [table cellspacing="0" border="1" style="border-color: #000000; border-width: 1px; ; width: 100%;"] [tbody] [tr] [td] [table cellspacing="0" border="0" style="width: 100%;"] [tbody] [tr] [td style="width: 70%; padding: 5px;"][strong][span style="font-size: 13px;"]HEADER 1[/span][/strong][/td] [td style="width: 30%; padding: 5px;"][strong][span style="font-size: 13px;"]HEADER 2[/span][/strong][/td] [/tr] [/tbody] [/table] [/td] [/tr] [tr] [td style="padding-top: 10px; padding-bottom: 10px;"] [table cellspacing="0" border="0" style="width: 100%;"] [tbody] [tr] [td align="right" style="padding-right: 5px; padding-left: 5px; width: 25%;"][strong][span style="font-size: 13px;"]ROW 1 - COLUMN A[/span][/strong][/td] [td style="padding-left: 5px; padding-right: 5px; width: 45%;"][span style="font-size: 13px;"]ROW 1 - COLUMN B[/span][/td] [td rowspan="7" style="width: 30%; padding: 5px;"][p][span style="font-size: 16px;"][strong]COLUMN C[/strong][/span][/p][/td] [/tr] [tr] [td align="right" style="padding-right: 5px; padding-left: 5px; width: 25%;"][strong][span style="font-size: 13px;"]ROW 2 - COLUMN A[/span][/strong][/td] [td align="left" style="padding-left: 5px; padding-right: 5px; width: 45%;"][span style="font-size: 13px;"]ROW 2 - COLUMN B[/span][/td] [/tr] [tr] [td align="right" style="padding-right: 5px; padding-left: 5px; width: 25%;"][strong][span style="font-size: 13px;"]ROW 3 - COLUMN A[/span][/strong][/td] [td align="left" style="padding-left: 5px; padding-right: 5px; width: 45%;"][strong][span style="font-size: 13px;"]ROW 3 - COLUMN B[/span][/strong][/td] [/tr] [tr] [td align="right" style="padding-right: 5px; padding-left: 5px; width: 25%;"][strong][span style="font-size: 13px;"]ROW 4 - COLUMN A[/span][/strong][/td] [td align="left" style="padding-left: 5px; padding-right: 5px; width: 45%;"][p][span style="font-size: 13px;"]ROW 4 - COLUMN B[/span][/p][/td] [/tr] [tr] [td align="right" style="padding-right: 5px; padding-left: 5px; width: 25%;"][strong][span style="font-size: 13px;"]ROW 5 - COLUMN A[/span][/strong][/td] [td align="left" style="padding-left: 5px; padding-right: 5px; width: 45%;"]ROW 5 - COLUMN B[/td] [/tr] [tr] [td align="right" style="padding-right: 5px; padding-left: 5px; width: 25%;"][strong][span style="font-size: 13px;"]ROW 6 - COLUMN A[/span][/strong][/td] [td align="left" style="padding-left: 5px; padding-right: 5px; width: 45%;"][span style="font-size: 13px;"]ROW 6 - COLUMN B[/span][/td] [/tr] [tr] [td align="right" style="padding-right: 5px; padding-left: 5px; width: 25%;"][strong][span style="font-size: 13px;"]ROW 7 - COLUMN A[/span][/strong][/td] [td align="left" style="padding-left: 5px; padding-right: 5px; width: 45%;"][span style="font-size: 13px;"]ROW 7 - COLUMN B[/span][/td] [/tr] [/tbody] [/table] [/td] [/tr] [/tbody] [/table] [/body] Edit: I cannot make the HTML code to be quoted/uninterpreted in your forum ("
" doesn't work), please replace "[" character by "<" and "]" character by ">", thank you.