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 2 Line A</p>
42 <p>Page 2 Line B</p>
43 </tr></tbody></table>
44
45 <div class="spacer start">
46 <p>Page 3 Line 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 4 Line D</p>
50 <p>Page 4 Line E</p>
51 </td></tr></tbody></table></div></div></div></div>
52
53 <div class="spacer start">
54 <p>Page 5 Line F</p>
55 </div><div class="spacer backup"></div>
56 <table><tbody><tr><td class="allowInside">
57 <p>Page 5 Line G</p>
58 <p>Page 6 Line H</p>
59 </td></tr></tbody></table>
60
61 <div class="spacer start">
62 <p>Page 7 Line I</p>
63 </div><div class="spacer backup"></div>
64 <table><tbody><tr><td>
65 <p class="avoidAfter">Page 8 Line J</p>
66 <p>Page 8 Line K</p>
67 </td></tr></tbody></table>
68
69 <div class="spacer start">
70 <p>Page 9 Line L</p>
71 </div><div class="spacer backup"></div>
72 <table><tbody><tr><td>
73 <p>Page 10 Line M</p>
74 <p class="avoidBefore">Page 10 Line N</p>
75 </td></tr></tbody></table>
76
77 <div class="spacer start">
78 <p>Page 11 Line O</p>
79 </div><div class="spacer backup"></div>
80 <table><tbody><tr><td>
81 <div class="avoidAfter"><div>
82 <p>Page 12 Line P</p>
83 </div></div>
84 <p>Page 12 Line Q</p>
85 </td></tr></tbody></table>
86
87 <div class="spacer start">
88 <p>Page 13 Line R</p>
89 </div><div class="spacer backup"></div>
90 <table><tbody><tr><td>
91 <p>Page 14 Line S</p>
92 <div class="avoidBefore"><div>
93 <p>Page 14 Line T</p>
94 </div></div>
95 </td></tr></tbody></table>
96
97 <div class="spacer start">
98 <p>Page 15 Line O</p>
99 </div><div class="spacer backup"></div>
100 <table><tbody><tr><td>
101 <div><div>
102 <p class="avoidAfter">Page 16 Line P</p>
103 </div></div>
104 <p>Page 16 Line Q</p>
105 </td></tr></tbody></table>
106
107 <div class="spacer start">
108 <p>Page 17 Line R</p>
109 </div><div class="spacer backup"></div>
110 <table><tbody><tr><td>
111 <p>Page 18 Line S</p>
112 <div><div>
113 <p class="avoidBefore">Page 18 Line T</p>
114 </div></div>
115 </td></tr></tbody></table>
116 </body>
117 </html>