table-anonymous-block-004.xht (1300B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>CSS Test: The anonymous block box around a table is not used for table percentage width</title> 5 <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> 6 <link rel="help" href="http://www.w3.org/TR/CSS21/tables.html#model" /> 7 <meta name="assert" content="The percentage width of table is relative to its anonymous box's containing block." /> 8 <style type="text/css"> 9 #div1 10 { 11 width: 400px; 12 } 13 table 14 { 15 border-spacing: 0; 16 width: 50%; 17 } 18 td 19 { 20 background: black; 21 } 22 #div2 23 { 24 background: blue; 25 height: 1em; 26 width: 200px; 27 } 28 </style> 29 </head> 30 <body> 31 <p>Test passes if boxes below are the same width.</p> 32 <div id="div1"> 33 <table> 34 <tr> 35 <td>X</td> 36 </tr> 37 </table> 38 </div> 39 <div id="div2"></div> 40 </body> 41 </html>