fixed-table-layout-007

Fixed table width is maximum between table and sum of column 'width' (table width wins)

WeasyPrint

This browser

Assertion
A fixed layout table's width will be its specified width if that width is greater than the sum of its columns' widths.

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 width is maximum between table and sum of column 'width' (table width wins)</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="A fixed layout table's width will be its specified width if that width is greater than the sum of its columns' widths.">
 9         <style type="text/css">
10             table
11             {
12                 border-spacing: 0;
13                 table-layout: fixed;
14             }
15             td
16             {
17                 background: black;
18                 padding: 0;
19                 width: 50px;
20             }
21             #div1
22             {
23                 background: blue;
24                 height: 1em;
25             }
26             #div1, table
27             {
28                 width: 200px;
29             }
30         </style>
31     </head>
32     <body>
33         <p>Test passes if the boxes below are the same width.</p>
34         <table>
35             <tr>
36                 <td>X</td>
37                 <td>X</td>
38             </tr>
39         </table>
40         <div id="div1"></div>
41     </body>
42 </html>