CSS page-break-inside Property

Beginner
⏱️ 6 min read
📚 Updated: Jun 2026
🎯 4 Examples
Print & Columns

What You’ll Learn

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.

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.

📝 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.

🎯 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.

⚡ Quick Reference

QuestionAnswer
Initial valueauto
Applies toBlock-level elements
InheritedNo
AnimatableNo
Common usePrint page breaks inside block elements

💎 Property Values

The page-break-inside property accepts keyword values that control whether page breaks are allowed inside an element when printing.

ValueExampleDescription
autopage-break-inside: auto;Default. Allows page breaks to be inserted inside the element.
avoidpage-break-inside: avoid;Avoids inserting a page break inside the element, keeping the content together on the same page if possible.
initialpage-break-inside: initial;Sets the property to its default value (auto).
inheritpage-break-inside: inherit;Inherits the value from the parent element.
auto avoid

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.

👀 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

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.

page-break-inside-example.html
<style>
  table {
    page-break-inside: avoid;
    width: 100%;
    border-collapse: collapse;
  }
  th, td {
    border: 1px solid black;
    padding: 8px;
    text-align: left;
  }
</style>

<h1>Table with Page Break Avoidance</h1>
<table>
  <thead>
    <tr>
      <th>Header 1</th>
      <th>Header 2</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Row 1, Cell 1</td>
      <td>Row 1, Cell 2</td>
    </tr>
    <tr>
      <td>Row 2, Cell 1</td>
      <td>Row 2, Cell 2</td>
    </tr>
  </tbody>
</table>
Try It Yourself

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>

<section class="report-card">
  <h2>Summary</h2>
  <p>This card should stay together on one printed page.</p>
</section>
Try It Yourself

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.

page-break-figure.html
<style>
  figure {
    page-break-inside: avoid;
  }
</style>

<figure>
  <img src="chart.png" alt="Sales chart">
  <figcaption>Figure 1: Quarterly sales</figcaption>
</figure>
Try It Yourself

How It Works

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.

Example 4 — Print-Only Avoid Rules

Apply page-break-inside: avoid inside @media print for tables, figures, and grouped blocks.

page-break-print.css
@media print {
  table,
  figure,
  .keep-together {
    page-break-inside: avoid;
  }
}
Try It Yourself

How It Works

Screen users see a normal scrolling page. When printing, tables, figures, and grouped blocks avoid internal page breaks for cleaner output.

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.

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 Chrome 51+ · Desktop & Mobile
Full support
Mozilla Firefox 65+ · Desktop & Mobile
Full support
Apple Safari 10+ · macOS & iOS
Full support
Microsoft Edge 79+ · Chromium
Full support
Opera 38+ · 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 property 96% supported

Bottom line: page-break-inside remains widely supported for print. Always test in print preview, and prefer break-inside in new stylesheets.

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.

💡 Best Practices

✅ Do

  • 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

Key Takeaways

Knowledge Unlocked

Five things to remember about page-break-inside

Use these points when controlling printed page breaks.

5
Core concepts
02

auto Default

Browser decides.

Default
🖨 03

avoid

Keep blocks together.

Keyword
04

Tables

Common use case.

Pattern
bi 05

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.

Practice in the Live Editor

Open the HTML editor, apply page-break-inside, and test print page breaks in print preview.

HTML Editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful