fixed-table-layout-004

Fixed table layout

WeasyPrint

This browser

Assertion
The width of a column-spanning cell (which determines column widths in fixed table layout) is divided over the columns it spans.

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: 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="flags" content="">
 8         <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.">
 9         <style type="text/css">
10             table
11             {
12                 border-collapse: collapse;
13                 margin: 0;
14                 table-layout: fixed;
15                 width: 100px;
16             }
17             #cell1
18             {
19                 background: black;
20                 width: 98px;
21             }
22             td
23             {
24                 height: 20px;
25                 padding: 0;
26             }
27             #cell2
28             {
29                 background: silver;
30             }
31             #cell3
32             {
33                 background: orange;
34             }
35             #div1
36             {
37                 background: blue;
38                 height: 20px;
39                 width: 100px;
40             }
41         </style>
42     </head>
43     <body>
44         <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>
45         <table>
46             <tr>
47                 <td id="cell1" colspan="2"></td>
48            </tr>
49            <tr>
50                 <td id="cell2"></td>
51                 <td id="cell3"></td>
52            </tr>
53         </table>
54         <div id="div1"></div>
55     </body>
56 </html>