fixed-table-layout-002.xht (1501B)
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: Value other than 'auto' for column width sets width of cells in the column</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 column element with a value other than 'auto' for the 'width' property sets the width for the column of cells it contains." /> 8 <style type="text/css"> 9 table 10 { 11 border-collapse: collapse; 12 table-layout: fixed; 13 width: 200px; 14 } 15 #col 16 { 17 width: 100px; 18 } 19 td 20 { 21 padding: 0; 22 } 23 #cell 24 { 25 background: black; 26 } 27 #div1 28 { 29 background: blue; 30 height: 1em; 31 width: 100px; 32 } 33 </style> 34 </head> 35 <body> 36 <p>Test passes if the boxes below are the same width.</p> 37 <table> 38 <col id="col" /> 39 <col /> 40 <tr> 41 <td id="cell">X</td> 42 <td></td> 43 </tr> 44 </table> 45 <div id="div1"></div> 46 </body> 47 </html>