Forum Bugs

Wrong table width calculation (b/c of colspan?)

volker.haas
Hi,

table width calculation seems to go wrong in my referenced example [1]. The width limit of the table (as set in the stylesheet) is not obeyed, and the table spills over the column boundary. If the colspan is removed (and one column in the second table row) the width calculation seems fine.

The test were done using the latest version of prince (9.0-3).

I would be grateful for a workaround or fix.

Best Regards,
Volker


[1] http://pediapress.com/files/prince/1/test.html
mikeday
Surprisingly tricky. The colspan does seem to complicate the width calculation. The image is slightly too big to fit, but because it's in a colspan cell, Prince is having trouble estimating the correct table width, which it needs to do before the image can be scaled down.

So far I can only make it work if I give a fixed width to either the table, or the image, eg. 5cm. To keep using percentage widths it is necessary to take the image out of the colspan, and use some other technique for the image caption.
volker.haas
Thanks for the quick reply.

Unfortunately setting a fixed doesn't really help as well: the column width in the above example is 6.03cm - if this is set as the table width instead of 100% the result is the same as in the original example.

Regards,
Volker
mikeday
6.03cm seems too big, using 5.5cm works though.
volker.haas
You are certainly right Mike, using 5.5cm works for the table in the example.
The problem is that I can't really set that globally since this forces tables without the colspanning-problem to be restricted to a wrong width. Therefore this is not an option.
If you don't think this can be fixed in prince I need to work around that issue in a different way.

Regards,
Volker
mikeday
Avoiding the colspan is probably the best approach for the time being.