The page-break-inside property controls page breaks inside an element when a document is printed. It is especially useful for keeping tables, images, and other blocks together on one page.
01
Keep Together
Prevent awkward splits.
02
Syntax
auto and avoid.
03
Tables
Stop row splits.
04
Figures
Image + caption.
05
avoid
Most common value.
06
@media print
Print-only rules.
Fundamentals
Introduction
The page-break-inside property in CSS is used to control the behavior of page breaks inside an element when printing a document.
This property is particularly useful for ensuring that content such as tables or images are not split across pages, providing a more readable printed document.
Definition and Usage
Apply page-break-inside: avoid to block-level elements when you want the browser to keep the entire element on one printed page if possible. This is a common pattern for tables, figures, cards, and summary boxes in reports.
Like other print properties, page-break-inside usually has little or no visible effect on a normal scrolling screen layout. Test your rules in the browser’s print preview to see the real result.
💡
Beginner Tip
On normal screen layouts, page-break-inside may have little visible effect. It shines in print preview where the browser paginates your document.
Foundation
📝 Syntax
The syntax for the page-break-inside property is simple and can be applied to any block-level element.
syntax.css
element{page-break-inside:value;}
Basic Example
page-break-inside.css
table{page-break-inside:avoid;}
Syntax Rules
Apply page-break-inside to block-level elements such as headings, sections, and divs.
The value is a keyword: auto or avoid.
avoid is the most useful value for keeping tables and figures intact when printing.
The property is not inherited — set it on the element you want to keep together.
Use inside @media print when you only want breaks when printing.
For new projects, consider the modern break-inside property as a replacement.
Defaults
🎯 Default Value
The default value of the page-break-inside property is auto. This means the browser may automatically insert page breaks inside the element as needed.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Initial value
auto
Applies to
Block-level elements
Inherited
No
Animatable
No
Common use
Print page breaks inside block elements
Reference
💎 Property Values
The page-break-inside property accepts keyword values that control whether page breaks are allowed inside an element when printing.
Value
Example
Description
auto
page-break-inside: auto;
Default. Allows page breaks to be inserted inside the element.
avoid
page-break-inside: avoid;
Avoids inserting a page break inside the element, keeping the content together on the same page if possible.
initial
page-break-inside: initial;
Sets the property to its default value (auto).
inherit
page-break-inside: inherit;
Inherits the value from the parent element.
autoavoid
Context
When Does page-break-inside Matter?
page-break-inside only affects paginated output. These are the most common use cases:
Tables — Use page-break-inside: avoid so rows are not split across two printed pages.
Figures and images — Keep an image and its caption together on one page.
Cards and callouts — Prevent summary boxes from breaking in the middle.
Readable grouping — Use avoid on any block that should read as one unit when printed.
On a normal scrolling web page, you may not see any effect — that is normal. Test in print preview to verify behavior.
Preview
👀 Live Preview
Compare default splitting with page-break-inside: avoid, which tries to keep the whole block on one printed page.
avoid — kept together
Table rows, image, and caption stay on the same page.
auto — may split
Row 1 and Row 2
page break inside element
Row 3 continues on next page
Hands-On
Examples Gallery
Start with the reference table example, keep cards and figures together, and apply print-only avoid rules.
🖨 Keep Content Together
Use page-break-inside: avoid so important blocks are not split across printed pages — matching the reference example.
Example 1 — Table with Page Break Avoidance
In this example, we’ll prevent a table from being split across two pages when printed.
Open print preview (Ctrl+P) to see the table kept together:
Header 1
Header 2
Row 1, Cell 1
Row 1, Cell 2
Row 2, Cell 1
Row 2, Cell 2
How It Works
page-break-inside: avoid on the table tells the browser not to split the table across pages when possible, which keeps the data easier to read in print.
Example 2 — Keep a Card Together
Apply page-break-inside: avoid to a card or summary block so it does not break in the middle when printed.
page-break-card.html
<style>.report-card{page-break-inside:avoid;padding:1rem;border:1px solid #e2e8f0;border-radius:0.5rem;}</style><sectionclass="report-card"><h2>Summary</h2><p>This card should stay together on one printed page.</p></section>
This card should stay together on one printed page.
How It Works
The entire .report-card is treated as one printable unit. If it does not fit on the current page, the browser moves the whole card to the next page instead of splitting it.
Example 3 — Keep a Figure Together
Use page-break-inside: avoid on a figure so an image and caption are not separated in print.
Applying avoid to the figure keeps the image and caption on the same printed page, which looks more professional than a caption alone on the next page.
📄 Print Stylesheets
Scope keep-together rules to print only so screen layouts stay unchanged.
Example 4 — Print-Only Avoid Rules
Apply page-break-inside: avoid inside @media print for tables, figures, and grouped blocks.
.keep-together { page-break-inside: avoid; } — reusable utility class
How It Works
Screen users see a normal scrolling page. When printing, tables, figures, and grouped blocks avoid internal page breaks for cleaner output.
Companion
page-break-inside vs break-inside
page-break-inside is the legacy print property. The modern replacement is break-inside, which also supports column and region breaks.
In legacy stylesheets, page-break-inside: avoid is equivalent to break-inside: avoid. When writing new CSS, prefer break-inside for better long-term support.
legacy-vs-modern.css
/* Legacy */table{page-break-inside:avoid;}/* Modern equivalent */table{break-inside:avoid;}
🧠 How page-break-inside Works
1
Content is paginated for print
When you print or export to PDF, the browser splits the document into pages.
Print media
2
You set page-break-inside on an element
Choose auto or avoid to control whether breaks are allowed inside that element.
CSS rule
3
The browser applies the break rule
The browser keeps the element together on one page when avoid is used, or may split it when auto allows breaks.
Layout engine
=
📄
Organized printed output
Tables, figures, and grouped blocks stay intact instead of splitting awkwardly across pages.
Compatibility
Browser Compatibility
The page-break-inside property is supported in most modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. However, it is always a good practice to test your printed documents across different browsers to ensure consistent behavior.
✓ Legacy · Print support
Reliable print page-break control
Chrome, Firefox, Safari, Edge, and Opera support page-break-inside for printed output.
96%Modern browser support
Google Chrome51+ · Desktop & Mobile
Full support
Mozilla Firefox65+ · Desktop & Mobile
Full support
Apple Safari10+ · macOS & iOS
Full support
Microsoft Edge79+ · Chromium
Full support
Opera38+ · Modern versions
Full support
Testing tip
Use the browser’s print preview to verify page-break-inside rules. For new projects, consider migrating to break-inside.
page-break-inside property96% supported
Bottom line:page-break-inside remains widely supported for print. Always test in print preview, and prefer break-inside in new stylesheets.
Wrap Up
Conclusion
The page-break-inside property is a valuable tool for web developers who need precise control over how content is printed.
By using this property, you can ensure that important elements like tables and images are not awkwardly split across pages, resulting in more professional and readable printed documents. Experiment with this property to improve the print layout of your web projects.
Use page-break-inside: avoid on tables, figures, and cards in print
Scope avoid rules inside @media print
Apply avoid to any block that should read as one unit
Test in print preview in every target browser
Migrate legacy rules to break-inside when updating stylesheets
❌ Don’t
Expect visible effects on normal scrolling screen pages
Assume avoid works on elements taller than one printed page
Use page-break-inside in new projects when break-inside is available
Apply break rules without testing the printed output
Forget that very large tables may still need layout changes beyond CSS alone
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about page-break-inside
Use these points when controlling printed page breaks.
5
Core concepts
📄01
Print Only
Paged media focus.
Purpose
⚙02
auto Default
Browser decides.
Default
🖨03
avoid
Keep blocks together.
Keyword
▦04
Tables
Common use case.
Pattern
bi05
break-inside
Modern replacement.
Companion
❓ Frequently Asked Questions
The page-break-inside property controls whether a page break is allowed inside an element when printing. It helps keep tables, images, and other blocks together on one page.
The default value is auto. The browser may insert page breaks inside the element when needed.
auto allows breaks inside the element. avoid tries to keep the entire element on one printed page without splitting it.
Use it on tables, figures, cards, and other content blocks that should not be awkwardly split across two printed pages.
page-break-inside is the older legacy property for print. break-inside is the modern replacement. Browsers still support page-break-inside, but new projects should prefer break-inside.