CSS page-break-inside

The page-break-inside property in CSS is used to specify whether a page break should be allowed inside a specified element. By default, page breaks are allowed inside block-level elements.

Here is an example of how to use the page-break-inside property:

Result:

    
This content will not be broken across pages.

In the example above, the content inside the <div> element will not be broken across pages due to the page-break-inside: avoid; property.

Here is another example using a table:

Result:

    
Cell 1 Cell 2

In this example, the content inside the table cells will not be broken across pages due to the page-break-inside: avoid; property applied to each cell.

It is important to note that the page-break-inside property is only supported in certain browsers, so it is recommended to test the behavior across different browsers when using this property.