Forum Bugs

Overflow: hidden bug

bookdev
The following code stops a table in the third column from extending beyond the column width:

table {table-layout:fixed; max-width: 100%}
body {column-count: 3; Overflow: hidden}

However, it doesn't seem to have any effect in Prince when the table is in the first or second column. This even happens to different parts of the same table. (See attached example.) The usual result is the table text overlaps the text in the next column.

CSS specifies (http://www.w3.org/TR/css3-multicol/#overflow-inside-multicol-elements) text "that extends into column gaps is clipped in the middle of the column gap."

Therefore, am I doing something wrong? Or is this a bug in Prince?

Could you please be so kind as to let me know if there is any other way in Prince to stop (or truncate) a table from extending beyond the column width, if you don't mind?
  1. overflow_bug.zip71.9 kB
mikeday
Because "overflow: hidden" is applied to the body element, only the table content that actually extends outside the body will be clipped. Content that overlaps columns is still within the body, so it will not be clipped.

Currently there is no way to clip content within a column. However, is this what you actually want? I would have thought that displaying the whole table would be better, perhaps by flowing it out of the columns into a separate page float, eg. float: bottom.
bookdev
Thanks for the explanation, Mike. And I have noticed that in Prince, even when "overflow: hidden" is applied to the div element it doesn't work; e.g. {columns: 3; column-gap: 1em; overflow:hidden}.

The CSS3 definition for overflow suggests it should work: 8.1. Overflow inside multicol elements: Content that extends into column gaps (e.g., long words or images) is clipped in the middle of the column gap. (See: http://www.w3.org/TR/css3-multicol/#overflow-inside-multicol-elements). So I assume Prince will eventually clip content within a column?

But you are right. What I really need is for float: bottom-if-necessary to categorize an overflow as "necessary". That way the table would stay in the multicol format if it fits and drop out if it doesn't. Hopefully, you could add that to the road map? Or is there another way to do that?
mikeday
This is something we're going to have to add to the roadmap. :)
bookdev
Thanks Mike! Tables are the one thing that always seem to muck up my PDFs.