table-visual-layout-026d.xht (2086B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 3 <html xmlns="http://www.w3.org/1999/xhtml"> 4 5 <head> 6 7 <title>CSS Test: width of column in border-collapse separate model must include cell padding</title> 8 9 <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> 10 <link rel="author" title="Bruno Fassino" href="http://www.brunildo.org/" /> 11 <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@MIT.EDU" /> 12 <link rel="bookmark" href="http://www.brunildo.org/test/TablesBM2_s.html" title="table cells width & box model (standards)" /> 13 <link rel="bookmark" href="http://lists.w3.org/Archives/Public/www-style/2011Oct/0503.html" title="[css21] Section 17.5.2.1 should be clarified" /> 14 <link rel="bookmark" href="http://lists.w3.org/Archives/Public/www-style/2011Apr/0743.html" title="[css21] Section 17.5.2.1 should be clarified" /> 15 <link rel="help" href="http://www.w3.org/TR/CSS21/tables.html#table-layout" title="17.5 Visual layout of table contents" /> 16 <link rel="match" href="../reference/ref-filled-green-100px-square.xht" /> 17 18 <meta content="In the separated borders model, the edges of columns coincide with the border edges of cells. Therefore, a column width must include horizontal padding of cells." name="assert" /> 19 20 <style type="text/css"><![CDATA[ 21 table#red-overlapped 22 { 23 border-collapse: separate; 24 border-spacing: 0px; 25 table-layout: fixed; 26 } 27 28 col {width: 50px;} 29 30 td 31 { 32 background-color: red; 33 height: 50px; 34 padding: 0px 33px 0px 17px; 35 } 36 37 div#overlapping-green 38 { 39 background-color: green; 40 bottom: 100px; 41 height: 100px; 42 left: auto; 43 position: relative; 44 width: 100px; 45 } 46 ]]></style> 47 48 </head> 49 50 <body> 51 52 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 53 54 <table id="red-overlapped"> 55 56 <col></col><col></col> 57 58 <tr> 59 <td></td><td></td> 60 </tr> 61 62 <tr> 63 <td></td><td></td> 64 </tr> 65 66 </table> 67 68 <div id="overlapping-green"></div> 69 70 </body> 71 </html>