table-layout-applies-to-005

Table-layout and 'display: inline-block' elements

WeasyPrint

This browser

Flags
ahem
Assertion
Table-layout does not apply to 'display: inline-block' elements.

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: Table-layout and 'display: inline-block' elements</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#propdef-table-layout">
 7         <link rel="help" href="http://www.w3.org/TR/CSS21/tables.html#width-layout">
 8         <meta name="flags" content="ahem">
 9         <meta name="assert" content="Table-layout does not apply to 'display: inline-block' elements.">
10         <style type="text/css">
11             #test
12             {
13                 display: inline-block;
14                 table-layout: fixed;
15                 width: 10em;
16             }
17             .colgroup
18             {
19                 display: table-column-group;
20                 width: 5em;
21             }
22             .tr
23             {
24                 display: table-row;
25             }
26             .td
27             {
28                 background: black;
29                 display: table-cell;
30                 font: 1em Ahem;
31                 overflow: hidden;
32                 padding: 0;
33             }
34             #reference
35             {
36                 background: blue;
37                 height: 2em;
38                 width: 20em;
39             }
40         </style>
41     </head>
42     <body>
43         <p>Test passes if both bars below are the same width.</p>
44         <div id="test">
45             <div class="colgroup"></div>
46             <div class="colgroup"></div>
47             <div class="tr">
48                 <div class="td">XXXXX</div>
49                 <div class="td">XXXXX</div>
50             </div>
51             <div class="tr">
52                 <div class="td">XXXXXXXXX0</div>
53                 <div class="td">XXXXXXXXX0</div>
54             </div>
55         </div>
56         <div id="reference"></div>
57     </body>
58 </html>