separated-border-model-004

Width of a table in separated borders mode

WeasyPrint

This browser

Assertion
The width of a CSS table is the distance from the left inner padding edge to the right inner padding edge (including the border spacing but excluding padding and border).

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3     <head>
 4         <title>CSS Test: Width of a table in separated borders mode</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#separated-borders">
 7         <meta name="flags" content="">
 8         <meta name="assert" content="The width of a CSS table is the distance from the left inner padding edge to the right inner padding edge (including the border spacing but excluding padding and border).">
 9         <style type="text/css">
10             #table
11             {
12                 display: table;
13                 width: 200px;
14                 padding: 0 50px;
15                 border-spacing: 50px 0;
16                 border-right: 100px solid white;
17                 border-left: 100px solid white;
18             }
19             #tr
20             {
21                 display: table-row;
22             }
23             #td
24             {
25                 display: table-cell;
26                 background: black;
27                 height: 10px;
28                 width: 50px;
29                 overflow: visible;
30             }
31             #reference
32             {
33                 background: blue;
34                 left: 208px; 
35                 height: 10px;
36                 margin-top: 10px;
37                 position: absolute;
38                 width: 100px;
39             }
40         </style>
41     </head>
42     <body>
43         <p>Test passes if the black and blue boxes are the same width.</p>
44         <div id="table">
45             <div id="tr">
46                 <div id="td"></div>
47             </div>
48         </div>
49         <div id="reference"></div>
50     </body>
51 </html>