What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Short answer: DOMPDF has no universal CSS switch that keeps two independently flowing columns aligned across page boundaries. First decide whether your content is made of paired items or two streams that must continue independently. For paired items, use one table row per pair and keep every row short enough to fit on a page. For genuinely independent columns, simplify the layout, render the columns separately and merge the PDFs, or evaluate another renderer. Confirm the result with a minimal document in the exact DOMPDF version, PHP version, paper size and CSS used by your application.

Why DOMPDF columns jump

DOMPDF is mostly CSS 2.1 compliant, but its pagination model is not a browser’s multicolumn layout engine. A complex block, inline-block or table structure can be laid out as a sequence of frames, then moved when the next page is calculated. A supported property such as page-break-inside does not guarantee that two unrelated flows will remain side by side.

The most important constraint is documented by the project: “Table cells are not pageable, meaning a table row must fit on a single page.” A table is therefore useful for keeping a left/right pair together, but it cannot make an arbitrarily tall pair flow across pages.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Identify which kind of columns you need

Paired content

Use this model when item A on the left belongs with item A on the right: a label and value, two fields from one record, or a comparison row. The relationship should be represented in the document structure, not simulated with two independent blocks.

Independent streams

Use this model when the left column and right column each have their own reading order and either may continue for several pages. A table can distort this requirement because each row is an indivisible pagination unit. DOMPDF may not provide a reliable in-engine solution for this design.

Recommended structure for paired columns

Put each logical pair in one table row. Give the table explicit widths and avoid placing a page-break rule on a row-group element such as thead or tbody; DOMPDF’s compatibility notes do not support page-break properties on table row groups.

<style>n  @page { size: A4 portrait; margin: 18mm; }n  table.pairs { width: 100%; border-collapse: collapse; table-layout: fixed; }n  table.pairs td { width: 50%; vertical-align: top; padding: 4mm; }n  table.pairs tr { page-break-inside: avoid; }n</style>n<table class="pairs">n  <tr>n    <td><strong>Name</strong><br>Ada Lovelace</td>n    <td><strong>Role</strong><br>Mathematician</td>n  </tr>n  <!-- one short logical pair per row -->n</table>

The page-break-inside: avoid declaration expresses your intent, but it is not a promise that every structure will honor it. The row still has to fit within the printable page area. If one cell contains a long paragraph, split that content into several logical rows or redesign the presentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Diagnose the break before changing the template

  1. Record the environment. Note the installed DOMPDF release, PHP version, paper size, orientation, margins, fonts and relevant CSS. Behavior can differ between releases and configurations.
  2. Create a minimal reproduction. Keep only the affected section, the same text lengths and the styles that trigger the shift. Remove headers, footers, unrelated tables, framework CSS and JavaScript-generated markup.
  3. Classify the symptom. Is a paired row moving intact, are the two streams separating, are widths changing, or is content simply too tall for the remaining page space?
  4. Turn on diagnostics. DOMPDF troubleshooting documentation describes page-break logging with $_DOMPDF_DEBUG_TYPES = ['page-break' => true], frame details with $_dompdf_debug, and visual layout boxes through debugLayout and its box options. Use the configuration style required by your installed integration.
  5. Change one variable at a time. Test structure, widths, page-break rules and content size separately. A simultaneous rewrite makes the cause impossible to identify.

CSS details that commonly mislead

Apply rules to the right element

The documented compatibility list marks page-break-before, page-break-after, page-break-inside and table-layout as supported. It also says page-break properties are not supported on table row groups. Apply a rule to the element whose break you actually need to control, and do not assume a declaration on tbody controls each row.

Do not treat support as a guarantee

“Supported” means the property is recognized, not that a complex combination of nested tables, floats, inline blocks and framework styles will paginate exactly as a browser does. Remove unsupported or unnecessary layout features from the reproduction first.

Set widths explicitly

A DOMPDF 1.0.2 issue reported that specified table column widths were ignored when page-break-inside: avoid was triggered, with columns divided evenly; the issue author said 0.8.5 retained the widths. That was a version-specific report associated with milestone 1.1.0, not evidence that every current release has the same defect. If widths change, test your exact version with explicit table width, cell widths and table-layout: fixed.

When independent columns must continue separately

A historical 2016 DOMPDF issue described a sequential inline-block layout in which the second column appeared on page two after the first column continued there. The maintainer’s case-specific advice was that there was no straightforward workaround when either column could exceed a page. The discussion suggested rendering separate documents and merging them with FPDI. A later reply reported replacing the columns with a table, but then encountering the long-row limitation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Treat that approach as an architecture option, not a universal fix. Render the left and right streams independently, merge them only if your required reading order and page alignment permit it, and test headers, footers, page counts, bookmarks, fonts and blank trailing pages. If both columns must independently continue while remaining visually synchronized, simplifying the design or evaluating another renderer may be less fragile than accumulating CSS exceptions.

Decision guide

Approach Best fit Constraint
Table rows with paired items Each left/right pair belongs together Every row must fit on one page; long rows cannot split.
Separate documents, then merge Independent continuation is essential and separate rendering is acceptable Historical issue advice; verify alignment, headers and page totals in your workflow.
Simplify or redesign The current structure is unstable May require changing the visual design or renderer; no universal alternative is established here.
Page-break CSS adjustments A specific boundary can be controlled Element scope and layout complexity limit reliability; this is not an independent-column solution.

Troubleshooting checklist

The row moves to the next page

  • Measure the row’s total height including padding, borders, images and line wrapping.
  • Reduce content or split it into multiple logical rows.
  • Check that the table is not wider than the printable area, which can increase wrapping and height.
  • Test without page-break-inside: avoid to determine whether the rule is triggering a width or pagination interaction in your release.

The second column starts on a new page

  • Check whether the columns are independent streams rather than paired rows.
  • Remove framework styles, especially floats, negative margins and positioning, from the minimal reproduction.
  • Confirm that both columns have calculable widths and that their parent has a definite width.
  • If either stream can exceed one page, stop expecting a single CSS declaration to synchronize them; use a different structure or separate rendering.

Widths become equal unexpectedly

  • Reproduce with your exact DOMPDF version; the 1.0.2 report is not a current universal diagnosis.
  • Set table and cell widths explicitly and test with and without page-break-inside: avoid.
  • Inspect generated markup for missing closing tags or nested tables that alter the layout tree.

Blank pages or unexplained breaks appear

  • Inspect margins, forced page-break-before/after rules and oversized elements.
  • Use page-break and frame diagnostics to identify the element that was moved.
  • Check images and fonts for intrinsic dimensions larger than the available page area.

Performance, reliability and maintenance

Keep the reproduction and the production template structurally simple. Large nested tables, high-resolution images and excessive CSS increase layout work and make pagination failures harder to isolate. Cache or reuse stable assets where your application permits, but do not hide a layout problem by changing content lengths. Pin and record the DOMPDF version, then rerun the minimal pagination test whenever you upgrade PHP, DOMPDF, fonts, CSS frameworks or paper settings.

For automated systems, add assertions around page count and the presence of key text, and retain a sample PDF for visual review. Those checks do not prove every page is correct, but they catch regressions when a row suddenly moves or a column width changes.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your real goal is a clean screenshot or PDF of a web page rather than server-side DOMPDF layout, ScreenshotNeo provides a single HTTP request. It accepts consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups and chat widgets before capture; each step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info and capture_pdf tools for Claude, Cursor and other MCP clients.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

cURL:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

See the ScreenshotNeo documentation for the 63 capture options, including full-page loading, element selectors, device presets, PDF paper settings, custom CSS and JavaScript, waits, request blocking, authentication headers, cookies, geolocation, caching, signed links, asynchronous webhooks and bulk capture. The Free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.

Frequently Asked Questions

Can I force two independent DOMPDF columns to have identical page breaks?

No universal CSS switch is documented for that behavior. If both streams can continue independently, use a different document structure, separate rendering and merging, or another renderer.

Should I always replace columns with a table?

Only when each left/right pair belongs together. A table row must fit on one page, so it is unsuitable for arbitrarily long independent columns.

Is Bootstrap the cause of the page break?

A 2023 issue reported a separated two-column section while Bootstrap 3 styles were present, but that case does not prove Bootstrap caused every occurrence. Reproduce without framework CSS to isolate the variable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.