allowed-page-breaks-001b.xht (2951B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>CSS Test: allowed page breaks between table rows</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 9 sibling table rows is allowed only if the 'page-break-after' and 10 'page-break-before' properties of all the elements generating boxes 11 that meet at this margin are 'auto' and the common ancestors of all 12 the elements do not have a 'page-break-inside' value of 'avoid'."/> 13 <meta name="flags" content="may paged" /> 14 <style type="text/css"> 15 html, body { height: 100%; line-height: 1; font-size: 20px; margin: 0; padding: 0; } 16 .spacer { height: 50%; } 17 .backup { margin-top: -1em; } 18 .start { page-break-before: always; } 19 20 .avoidBefore { page-break-before: avoid; } 21 .avoidAfter { page-break-after: avoid; } 22 .avoidInside { page-break-inside: avoid; } 23 .allowInside { page-break-inside: auto; } 24 25 table, tbody, tr, td { 26 border-collapse: collapse; 27 margin: 0; padding: 0; 28 border-spacing: 0; 29 color: blue; 30 } 31 table, tbody { page-break-inside: avoid; /* override any UA settings */ } 32 </style> 33 </head> 34 <body> 35 <div class="spacer"> 36 Lines A-N must appear on the 10 pages of this test. The blue text 37 must accurately describe the page numbers. 38 </div><div class="spacer backup"></div> 39 <table><tbody class="avoidInside"> 40 <tr><td>Page 2 Line A</td></tr> 41 <tr><td>Page 2 Line B</td></tr> 42 </tbody></table> 43 44 <div class="spacer start"> 45 <tr><td>Page 3 Line C</td></tr> 46 </div><div class="spacer backup"></div> 47 <div class="avoidInside"><div><div><div><div><table><tbody class="allowInside"> 48 <tr><td>Page 4 Line D</td></tr> 49 <tr><td>Page 4 Line E</td></tr> 50 </tbody></table></div></div></div></div></div> 51 52 <div class="spacer start"> 53 <tr><td>Page 5 Line F</td></tr> 54 </div><div class="spacer backup"></div> 55 <table><tbody class="allowInside"> 56 <tr><td>Page 5 Line G</td></tr> 57 <tr><td>Page 6 Line H</td></tr> 58 </tbody></table> 59 60 <div class="spacer start"> 61 <tr><td>Page 7 Line I</td></tr> 62 </div><div class="spacer backup"></div> 63 <table><tbody> 64 <tr class="avoidAfter"><td>Page 8 Line J</td></tr> 65 <tr><td>Page 8 Line K</td></tr> 66 </tbody></table> 67 68 <div class="spacer start"> 69 <tr><td>Page 9 Line L</td></tr> 70 </div><div class="spacer backup"></div> 71 <table><tbody> 72 <tr><td>Page 10 Line M</td></tr> 73 <tr class="avoidBefore"><td>Page 10 Line N</td></tr> 74 </tbody></table> 75 </body> 76 </html>