table-height-algorithm-030

Cell boxes smaller than their rows receive extra padding

WeasyPrint

This browser

Flags
ahem
Assertion
A cell box that is smaller than height of its row receives extra top or bottom padding.

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: Cell boxes smaller than their rows receive extra padding</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#height-layout">
 7         <meta name="flags" content="ahem">
 8         <meta name="assert" content="A cell box that is smaller than height of its row receives extra top or bottom padding.">
 9         <style type="text/css">
10             table
11             {
12                 border-spacing: 0;
13             }
14             td
15             {
16                 color: blue;
17                 font: 16px/1em Ahem;
18                 padding: 0;
19                 vertical-align: middle;
20             }
21             #short
22             {
23                 color: orange;
24                 height: 1em;
25             }
26          </style>
27      </head>
28      <body>
29         <p>Test passes if there is orange box to the right of the blue box and the orange box is vertically aligned to the middle of the blue box.</p>
30         <table>
31             <tr>
32                 <td>
33                     XXXXX<br>
34                     XXXXX<br>
35                     XXXXX<br>
36                     XXXXX<br>
37                     XXXXX<br>
38                 </td>
39                 <td id="short">XXXXX</td>
40             </tr>
41         </table>
42     </body>
43 </html>