fixed-table-layout-004.xht (1733B)
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 layout</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="The width of a column-spanning cell (which determines column widths in fixed table layout) is divided over the columns it spans." /> 8 <style type="text/css"> 9 table 10 { 11 border-collapse: collapse; 12 margin: 0; 13 table-layout: fixed; 14 width: 100px; 15 } 16 #cell1 17 { 18 background: black; 19 width: 98px; 20 } 21 td 22 { 23 height: 20px; 24 padding: 0; 25 } 26 #cell2 27 { 28 background: silver; 29 } 30 #cell3 31 { 32 background: orange; 33 } 34 #div1 35 { 36 background: blue; 37 height: 20px; 38 width: 100px; 39 } 40 </style> 41 </head> 42 <body> 43 <p>Test passes if the blue and black bars are the same width and the gray and orange boxes are half of that width.</p> 44 <table> 45 <tr> 46 <td id="cell1" colspan="2"></td> 47 </tr> 48 <tr> 49 <td id="cell2"></td> 50 <td id="cell3"></td> 51 </tr> 52 </table> 53 <div id="div1"></div> 54 </body> 55 </html>