Forum Bugs

max-width: 100% on images inside tables aren't respected from version 13.4

blieck
After updating princexml from 13.1 to 13.5 we noticed tables with images inside don't resize properly.

The images have a max-width of 100% so the expected behaviour would be that the table can shrink to any width and the images inside resize as well.

When you open test.html in a webbrowser and resize your screen the images resize as well. In prince 13.1 this was the default behaviour. I expect the change "Fix issues affecting the sizing of inline blocks" made in 13.4 is the reason of this issue.
  1. img.png0.4 kB
  2. test - prince 13.1.pdf16.2 kB
  3. test - prince 13.4.pdf16.2 kB
  4. test.html0.7 kB
markbrown
Thanks, we will take a look and get back to you.
blieck
Is there an update on this? We've currently pinned our version of PrinceXML to 13.3 because this issue got introduced in version 13.4.
mikeday
No not yet sorry, it's still on our list.
lemonbit_announce
Good to hear it's on your list. We're also looking forward to this issue being fixed. Thanks!
mikeday
This is now fixed in the latest build, thanks for letting us know! :D
blieck
Great. Thanks!
josh
I am having a problem which is similar to this issue.

Attached are test files which are slightly modified from blieck's example.

In the html, some images with a max-width of 100% are in a table. The html is rendered finely into PDF when you specify the width for all the cells within a column (as in "test2_fine.pdf"). If you omit the width specification in one or more cells, however, the image gets too big (test file "test2_nogood.pdf").

The behavior I expect is, when you don't specify the width of a cell, its width should be the same as that of the upper/lower cell in the same column where it is specified.
Is this a bug?

I used build 20211217 on Mac OS 10.15.7.

Thanks in advance for your support.
  1. img.png0.4 kB
  2. test2_fine.html3.0 kB
  3. test2_fine.pdf32.8 kB
  4. test2_nogood.html3.0 kB
  5. test2_nogood.pdf34.0 kB
markbrown
The behavior I expect is, when you don't specify the width of a cell, its width should be the same as that of the upper/lower cell in the same column where it is specified.


Automatic table layout (the default) looks at all cells in the column to determine a proportionate width; the issue here is that Prince resolves the "cyclic" percentages in the second and third rows against the width available to the whole table, which differs from what browsers are doing.

So a possible workaround, other than the one you found above, is to use fixed table layout instead of automatic table layout. Fixed layout just looks at cell widths in the first row, which is perhaps closer to the behaviour you are expecting.

You can specify fixed table layout by putting table-layout: fixed on the table element. See the Tables documentation for more info.
josh
Applying "table-layout: fixed" to the table worked as I expect.
Thank you for your support!