fixed-table-layout-016.xht (1470B)
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: Fixed table width is maximum between table and sum of column 'width' (sum of columns' widths wins)</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#fixed-table-layout" /> 7 <meta name="assert" content="A fixed layout table's width will be the sum of its columns' widths if that number is greater than the table's specified width." /> 8 <style type="text/css"> 9 table 10 { 11 border-spacing: 0; 12 table-layout: fixed; 13 width: 75px; 14 } 15 td 16 { 17 background: black; 18 padding: 0; 19 width: 25px; 20 } 21 #div1 22 { 23 background: blue; 24 width: 100px; 25 } 26 #div1, td 27 { 28 height: 1em; 29 } 30 </style> 31 </head> 32 <body> 33 <p>Test passes if the boxes below are the same width.</p> 34 <table> 35 <tr> 36 <td></td> 37 <td></td> 38 <td></td> 39 <td></td> 40 </tr> 41 </table> 42 <div id="div1"></div> 43 </body> 44 </html>