Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
16.10.14, 17.4.7, 17.9.0
-
None
-
Integration
-
High
-
Medium
-
Description
The current behavior is to convert all table cell widths from absolute (pixel) values to relative (percentage) values. Even table cells that don't have a width specified get an explicit relative width in order to have a consistent style when the table is split across multiple print pages. This change from absolute to relative values doesn't change the table layout on the screen. The problem is though that a given percent, say 5%, that is more than enough for a large screen may be too little for the print page. The result is that you end up having columns too narrow, that can fit only a single character, so words are split after each character. This increases the number of print pages and thus slows down the PDF export because Paged.js needs more time to split the content into print pages.
An improvement would be to support enforcing a lower limit on the table cell width from the PDF template. The default PDF template would use a default value, say 8ch, that custom PDF templates can overwrite. Of course, this minimum width can be controlled by the table itself.
Enforcing a lower limit on the table cell width poses a problem though: if each table cell does this then it's very probable that a table with many columns might not fit the print page width. We need to do something to avoid tables from being cut from the print page (i.e. lose information). We could detect when the table overflows the print page horizontally and:
- try to reduce the font-size (but the table may contain images which are not affected)
- and, on top of that, if needed, scale down the table using CSS transformation