Is there an HTML and/or CSS equivalent of the nroff / troff concept of a "floating display?"

128 Views Asked by At

Is there an HTML and/or CSS equivalent of the nroff / troff concept of a "floating display*?"

Note that giving an HTML element a style attribute with a value of page-break-inside:avoid emulates an nroff / troff "static display*," not a "floating display."

(*) Here are descriptions of nroff / troff "static display" and "floating display" from Gehani, Document Formatting and Typesetting on the UNIX System, Vol. 1, p. 48:

... A static display ensures its contents have the same relative position in the formatted document as in the raw document. If the displayed material cannot fit on the current page, then rest of the current page left blank and the displayed material is printed on the next page.

A floating display does not guarantee that the displayed material will have the same relative position in the formatted document as it had in the raw document. If a floating display cannot fit on the current page, then it is printed as soon as possible after the top of the page. However, the remainder of the current page is not left blank; it is filled with items that follow the floating display in the raw document. The relative position between two floating display is always preserved. Of course, there may be several floating displays waiting to be printed a the next page change; if they all cannot fit there, then the remaining ones will flow onto the following page, and so on.

1

There are 1 best solutions below

1
Henrique Erzinger On

There isn't, as it would require changing the source order on the fly. If you can know for sure the paper size and the content is static, I imagine it would be more or less possible to achieve simulate it with flexbox/grid, but it would be hacky and in my opinion, defeat the purpose.