Short answer: treat page-break-inside: avoid as a pagination hint, not a guarantee. In wkhtmltopdf, overlap usually appears when the rule is applied to the wrong table element, the content is taller than a page, or a repeated header and moved row compete for limited space. Reproduce the smallest failing document, test the rule on the meaningful row or block, and inspect the PDF for overlap, split text, header artifacts and excessive blank space. Always validate with the exact wkhtmltopdf binary, options, margins and production HTML you deploy.
Why the rule can still produce overlap
CSS defines page-break-inside as a request to adjust breaks inside an element. avoid tells the user agent not to place an inside break where the rule applies when an alternative is available. It does not define a universal algorithm for tables, repeated headers, oversized rows or content that cannot fit on one page. wkhtmltopdf’s WebKit-based renderer has historical reports of ignored break rules, header overlap, border artifacts and unpredictable results around large rows.
Those reports concern particular historical binaries, including 0.12.2.1, 0.12.2.4 and 0.12.5.1, and users’ individual documents. They demonstrate possible failure modes, not a compatibility guarantee or a current-version diagnosis. Record your exact version and platform before changing CSS.
First, isolate the failing layout
- Save the exact command. Record wkhtmltopdf version, operating system, page size, orientation, margins, header/footer options, zoom and any JavaScript delays.
- Reduce the HTML. Keep one table or block, its relevant styles and enough rows to reproduce the overlap. Remove unrelated floats, positioned elements and scripts.
- Make three test cases. Test a row that fits in the remaining space, one that fits only on a fresh page, and one taller than a page. These cases reveal whether the issue is ordinary pagination or impossible-to-keep-together content.
- Compare PDFs, not just CSS. Check text overlap, split text, repeated table headings, orphaned borders and large blank areas. A moved break is not a fix if it creates a worse reader-facing artifact.
Apply the rule at the right scope
The element receiving the declaration matters. A historical wkhtmltopdf report found different behavior when the rule was placed on td versus tr; changing the selector altered both pagination and visual artifacts. That is evidence to test both scopes in your document, not proof that one selector is universally correct.
Recommended Free Tools
#1 Best Overall
- INNOVATIVE CARTRIDGE-FREE PRINTING — No more dealing with lots of tiny ink cartridges; With this wireless document and photo printer each ink bottle set is equivalent to about 90 individual cartridges²
- LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; When you choose this combination printer, scanner and copier you can print up to 4,500 pages black/7,500 color³
- COLOR PRINTING — Up to 2 years of ink in the box4 (and with every replacement ink set) for fewer out-of-ink frustrations
- ZERO CARTRIDGE WASTE — By using an Epson EcoTank printer you can help reduce the amount of cartridge waste ending up in landfills
- HOME PRINTER DESIGNED FOR RELIABILITY — The Epson EcoTank ET-2800 All-in-One Supertank Color Printer creates vivid, detailed prints and documents thanks to Micro Piezo Heat-Free Technology; Fire off 10 ISO pages per minute1 to easily finish large jobs
Keep a complete row together
table.invoice {
width: 100%;
border-collapse: collapse;
}
table.invoice thead {
display: table-header-group;
}
table.invoice tr {
page-break-inside: avoid;
}
table.invoice td,
table.invoice th {
padding: 6px;
vertical-align: top;
}
Use this when a row is a meaningful unit and normally fits on one page. Test whether your installed renderer honors it. If the row contains a long description, nested table or large image, it may still exceed the available page.
Try the cell scope only when your markup requires it
table.invoice td {
page-break-inside: avoid;
}
Some documents respond differently when the declaration is on cells. This can also produce inconsistent borders or header behavior in wkhtmltopdf, so keep the variant only if the generated PDF is demonstrably better.
Wrap a logical block, but do not assume wrappers solve oversized content
.keep-together {
page-break-inside: avoid;
}
Apply the class to a genuine block such as an invoice section or a card, not to every ancestor indiscriminately. A wrapper can change the renderer’s break candidates, but historical reports do not establish a universally correct wrapper. A block taller than a page cannot be kept intact without overflow, clipping or a move to a new page.
Understand the whitespace trade-off
When the next row does not fit in the remaining space, avoiding a break moves it to the next page. The unused area is expected: preserving the row consumes less of the current page than splitting it. A historical report also described a large blank region when an oversized row was moved. Decide whether that whitespace is preferable to a split or overlap.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
| Approach | Potential benefit | Cost or uncertainty |
|---|---|---|
Apply page-break-inside: avoid to a meaningful row or block |
May keep ordinary content together | Not reliable for every table; can leave whitespace or create artifacts. |
| Change markup or selector scope | Can change the renderer’s break candidates | No selector is proven universally correct; verify the resulting PDF. |
| Allow long content to split | Uses available page space more efficiently | May split text or rows at an undesirable point. |
Design markup that is easier to paginate
Keep table structure valid
Use a real thead, tbody and tr/td hierarchy. Put repeated-column headings in thead and test whether your wkhtmltopdf build repeats them correctly. Avoid using absolutely positioned elements for content that must flow between pages.
Rank #2
- CARTRIDGE-FREE PRINTING — Print lab-quality photos, graphics and creative projects; Get vibrant colors and sharp text with Epson's high-accuracy printhead and Claria ET Premium 6-color inks
- INK BOTTLES — Save on photos1 and creative projects with affordable in-house printing; All-in-one printer allows you to print 4" x 6" photos for about 4 cents each vs. 40 cents with traditional ink cartridges1
- LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; Printer, scanner and copier lets you print up to 6,200 color pages³
- PRINT FOR LONGER — Up to 2 years of ink in the box² (and with every replacement ink set) for fewer out-of-ink frustrations with this wireless printer
- ZERO CARTRIDGE WASTE — Epson EcoTank printer helps reduce the amount of cartridge waste ending up in landfills; Cartridge-free printer uses high-yield ink bottles; Each replacement ink bottle set is equivalent to about 100 individual ink cartridges⁴
Split unbounded content into smaller units
Instead of one row containing an entire long article, make each paragraph or item a separate row or block. Smaller units give the paginator legal break points and reduce the chance that one impossible-to-fit element triggers a move, overlap or clipping.
Control large images and nested content
img {
max-width: 100%;
height: auto;
}
.long-description {
overflow-wrap: anywhere;
}
These rules do not repair a renderer bug, but they prevent avoidable horizontal overflow and reduce the number of elements that are taller than a page.
Use explicit breaks sparingly
page-break-before: always (or its legacy equivalents) can start a known section on a new page, while page-break-after can end one. Explicit breaks are useful for cover pages and major sections, but adding them to every row magnifies whitespace and can interact badly with repeated headers. Prefer meaningful structural breaks plus tested avoidance rules.
Run a repeatable wkhtmltopdf test
wkhtmltopdf --page-size A4 --margin-top 18mm --margin-right 12mm
--margin-bottom 18mm --margin-left 12mm input.html output.pdf
Use the same command in local and production environments. If your document relies on JavaScript, fonts or remote images, confirm they are available to the process and allow enough loading time. A CSS change is not validated until the PDF generated by the deployed binary has been inspected.
Troubleshooting common symptoms
The rule appears ignored
Confirm the selector matches the element that actually contains the content. Check for a more specific rule, invalid table markup, an element that is taller than a page, or a different stylesheet being loaded in the conversion environment. Test the same HTML with the rule on tr, the relevant block, and (only if needed) td; compare artifacts rather than assuming a selector move is safe.
Rank #3
- SET IT UP ONCE AND PRINT WITH CONFIDENCE. No complicated maintenance. Just easy, reliable printing you can count on.
- INK FOR YEARS. NOT MONTHS. Up to 2 years of ink included. Get thousands of pages of cartridge-free printing. More pages, less hassle
- KEEPS PRINTING WELL AFTER COMPETITORS HAVE QUIT. No complex maintenance. Sharper text, richer colors.[2] Only with HP Smart Tank
- PREMIUM SUPPORT - Strong technical expertise to solve issues faster
- THE LAST PRINTER YOU'LL EVER NEED. Enjoy years of refillable, cartridge-free printing.
A header overlaps the first row
Check header HTML, top margin and any header-spacing option together. A repeated table header and a document header both consume vertical space. Reduce header height, increase the top margin, or simplify the header, then retest with a row that begins immediately after the page boundary.
A huge blank area appears
The next avoided element may not fit in the remaining space and has been moved. Test whether splitting a long description into smaller blocks produces an acceptable result. If the element is taller than a page, redesign it; no break-avoidance declaration can make it fit intact.
Borders are broken or duplicated
Compare border-collapse: collapse and separate borders in a minimal table. A historical report associated selector changes with border artifacts. Keep the variant that preserves readable boundaries across page breaks.
Results differ between machines
Record binary version, operating system, fonts, locale, page settings and input assets. Historical issue reports are not a current compatibility matrix, so a result from one build cannot be generalized to another.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Choose a fix using two acceptance criteria
- Content integrity: no overlap, clipped text, missing content or unacceptable row splits.
- Page quality: reasonable whitespace, correct repeated headings, intact borders and consistent section starts.
Generate representative PDFs after every change, including the largest real rows and the longest localized strings. Keep a known-good PDF or image comparison in your build checks if pagination is business-critical.
Rank #4
- Wireless Bluetooth Printer: Portable thermal printer compatible with iPhone, Android phones, iPad and tablet computers via Bluetooth. For smartphones, please download the "Nada Print" App. You can also connect to laptops and computers for printing using a USB-C cable. (Note: Laptops and computers can only be connected via USB and require the installation of a driver first. Bluetooth connection is not supported.)
- No-ink printing: Only supports US Letter and A4 size thermal paper.(Doesn't support regular paper) The no-ink portable thermal printer uses direct thermal technology, requiring no ink, toner or ribbons, making it environmentally friendly, cost-effective and time-saving. The thermal printer package comes with a roll of US Letter thermal printing paper. Note: When installing the paper, remember to switch the paper size switch on APP
- Clear Print: NDYIN N80 portable thermal printer adopts high-definition printing technology, with a 203DPI resolution to provide you with clear printing results. This mobile printer is compatible with roll paper, folded paper and tattoo transfer paper, supporting printing from your mobile phone PDF, Word, pictures and web pages anytime and anywhere. It is recommended to use our NDYIN thermal paper to achieve good printing quality
- Portable wireless printer for travel: The thermal printer is equipped with a built-in 1500mAh rechargeable battery, which can print 160 sheets of 8.5" x 11" thermal paper after being fully charged. It weighs only 1.5 pounds and is compact in size. This ink-free portable printer can be easily carried in a backpack or briefcase! It is perfect for business travel, cars, small offices, construction sites, schools and homes. You can print documents, contracts, invoices and boarding passes anytime and anywhere
- The N80 thermal printer has a wide range of uses. The package includes the N80 printer, a roll of US Letter paper(7m/roll), a user manual, a guide card, a type-C soft cable and a type C adapter. Note: The charging adapter is not included. Special thermal paper is required for use; ordinary paper cannot be used. This ink-free portable thermal printer is suitable for various scenarios such as home, school, travel, office, and outdoor, meeting the printing needs of different groups of people. This tattoo template printer is also compatible with tattoo transfer paper, making it an ideal choice for tattoo art
Or skip the browser setup
If your goal is a clean capture of a rendered page rather than debugging wkhtmltopdf pagination, ScreenshotNeo provides a website screenshot API and MCP server. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets; each step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and the response identifies the page verdict and billing status in headers. Its MCP tools—take_screenshot, get_page_info and capture_pdf—work with Claude, Cursor and other MCP clients.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →For a direct request, see the ScreenshotNeo documentation:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
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)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
All features are included on every plan. The Free plan provides 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account to try it.
Frequently Asked Questions
Can CSS guarantee that a wkhtmltopdf row will never split?
No. The declaration is a hint interpreted by the renderer, and content taller than a page cannot be kept intact without another layout consequence.
Should I use modern break-inside instead?
You may test it, but the documented failures here concern wkhtmltopdf behavior. Verify support and output in the exact binary you deploy rather than assuming a property rename changes pagination.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Is a blank area always evidence of a bug?
No. It can be the expected result of moving an avoided row to the next page. It becomes a defect when the whitespace or resulting artifacts make the document less usable than an acceptable split.
Quick Recap
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.

