allowed-page-breaks-001c

allowed page breaks between blocks within table cells

WeasyPrint

This browser

Flags
may, paged
Assertion
Unforced breaking in the vertical margin between sibling block boxes is allowed only if the 'page-break-after' and 'page-break-before' properties of all the elements generating boxes that meet at this margin are 'auto' and the common ancestors of all the elements do not have a 'page-break-inside' value of 'avoid'.

Source

  1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2 <html>
  3 <head>
  4 <title>CSS Test: allowed page breaks between blocks within table cells</title>
  5 <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
  6 <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props">
  7 <link rel="help" href="http://www.w3.org/TR/css3-page/#allowed-pg-brk">
  8 <meta name="assert" content="Unforced breaking in the vertical margin between  sibling block boxes is allowed only if the 'page-break-after' and  'page-break-before' properties of all the elements generating boxes  that meet at this margin are 'auto' and the common ancestors of all  the elements do not have a 'page-break-inside' value of 'avoid'.">
  9 <meta name="flags" content="may paged">
 10 <style type="text/css">
 11 	html, body { height: 100%; line-height: 1; font-size: 20px; margin: 0; padding: 0; }
 12 	.spacer { height: 50%; }
 13 	.backup { margin-top: -1em; }
 14 	.start { page-break-before: always; }
 15 
 16 	p {
 17 		margin: 0;
 18 		color: blue;
 19 	}
 20 
 21 	.avoidBefore { page-break-before: avoid; }
 22 	.avoidAfter	{ page-break-after:	avoid; }
 23 	.avoidInside { page-break-inside: avoid; }
 24 	.allowInside { page-break-inside: auto; }
 25 
 26 
 27 	table, tbody, tr, td {
 28 		border-collapse: collapse;
 29 		margin: 0; padding: 0;
 30 		border-spacing: 0;
 31 		color: blue;
 32 	}
 33 </style>
 34 </head>
 35 <body>
 36 	<div class="spacer">
 37 		Lines A-T must appear on the 18 pages of this test. The blue text
 38 		must accurately describe the page numbers.
 39 	</div><div class="spacer backup"></div>
 40 	<table><tbody><tr class="avoidInside">
 41 		<p>Page&nbsp;2&nbsp;Line&nbsp;A</p>
 42 		<p>Page&nbsp;2&nbsp;Line&nbsp;B</p>
 43 	</tr></tbody></table>
 44 
 45 	<div class="spacer start">
 46 		<p>Page&nbsp;3&nbsp;Line&nbsp;C</p>
 47 	</div><div class="spacer backup"></div>
 48 	<div class="avoidInside"><div><div><div><table><tbody><tr><td class="allowInside">
 49 		<p>Page&nbsp;4&nbsp;Line&nbsp;D</p>
 50 		<p>Page&nbsp;4&nbsp;Line&nbsp;E</p>
 51 	</td></tr></tbody></table></div></div></div></div>
 52 
 53 	<div class="spacer start">
 54 		<p>Page&nbsp;5&nbsp;Line&nbsp;F</p>
 55 	</div><div class="spacer backup"></div>
 56 	<table><tbody><tr><td class="allowInside">
 57 		<p>Page&nbsp;5&nbsp;Line&nbsp;G</p>
 58 		<p>Page&nbsp;6&nbsp;Line&nbsp;H</p>
 59 	</td></tr></tbody></table>
 60 
 61 	<div class="spacer start">
 62 		<p>Page&nbsp;7&nbsp;Line&nbsp;I</p>
 63 	</div><div class="spacer backup"></div>
 64 	<table><tbody><tr><td>
 65 		<p class="avoidAfter">Page&nbsp;8&nbsp;Line&nbsp;J</p>
 66 		<p>Page&nbsp;8&nbsp;Line&nbsp;K</p>
 67 	</td></tr></tbody></table>
 68 
 69 	<div class="spacer start">
 70 		<p>Page&nbsp;9&nbsp;Line&nbsp;L</p>
 71 	</div><div class="spacer backup"></div>
 72 	<table><tbody><tr><td>
 73 		<p>Page&nbsp;10&nbsp;Line&nbsp;M</p>
 74 		<p class="avoidBefore">Page&nbsp;10&nbsp;Line&nbsp;N</p>
 75 	</td></tr></tbody></table>
 76 
 77 	<div class="spacer start">
 78 		<p>Page&nbsp;11&nbsp;Line&nbsp;O</p>
 79 	</div><div class="spacer backup"></div>
 80 	<table><tbody><tr><td>
 81 		<div class="avoidAfter"><div>
 82 			<p>Page&nbsp;12&nbsp;Line&nbsp;P</p>
 83 		</div></div>
 84 		<p>Page&nbsp;12&nbsp;Line&nbsp;Q</p>
 85 	</td></tr></tbody></table>
 86 
 87 	<div class="spacer start">
 88 		<p>Page&nbsp;13&nbsp;Line&nbsp;R</p>
 89 	</div><div class="spacer backup"></div>
 90 	<table><tbody><tr><td>
 91 		<p>Page&nbsp;14&nbsp;Line&nbsp;S</p>
 92 		<div class="avoidBefore"><div>
 93 			<p>Page&nbsp;14&nbsp;Line&nbsp;T</p>
 94 		</div></div>
 95 	</td></tr></tbody></table>
 96 
 97 	<div class="spacer start">
 98 		<p>Page&nbsp;15&nbsp;Line&nbsp;O</p>
 99 	</div><div class="spacer backup"></div>
100 	<table><tbody><tr><td>
101 		<div><div>
102 			<p class="avoidAfter">Page&nbsp;16&nbsp;Line&nbsp;P</p>
103 		</div></div>
104 		<p>Page&nbsp;16&nbsp;Line&nbsp;Q</p>
105 	</td></tr></tbody></table>
106 
107 	<div class="spacer start">
108 		<p>Page&nbsp;17&nbsp;Line&nbsp;R</p>
109 	</div><div class="spacer backup"></div>
110 	<table><tbody><tr><td>
111 		<p>Page&nbsp;18&nbsp;Line&nbsp;S</p>
112 		<div><div>
113 			<p class="avoidBefore">Page&nbsp;18&nbsp;Line&nbsp;T</p>
114 		</div></div>
115 	</td></tr></tbody></table>
116 </body>
117 </html>