separated-border-model-003

HTML/XHTML table width equation

WeasyPrint

This browser

Assertion
The width of an HTML/XHTML table is the distance between the left and right table border edges.

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: HTML/XHTML table width equation</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 an HTML/XHTML table is the distance between the left and right table border edges.">
 9         <style type="text/css">
10             table
11             {
12                 border-spacing: 50px 0;
13              }
14             td
15             {
16                 width: 100px;
17             }
18             div
19             {
20                 background: blue;
21                 height: 100px;
22             }
23             table, td
24             {
25                 background: black;
26                 border: 25px solid black;
27                 padding: 25px;
28             }
29             div
30             {
31                 width: 400px;
32             }
33         </style>
34     </head>
35     <body>
36         <p>Test passes if the boxes below are the same width.</p>
37         <table>
38             <tr>
39                 <td>X</td>
40             </tr>
41         </table>
42         <div></div>
43     </body>
44 </html>