table-intro-example-002

Introduction to Tables (vertical-align)

WeasyPrint

This browser

Flags
HTMLonly
Assertion
'vertical-align' can be set on table cells (example from section 17.1).

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: Introduction to Tables (vertical-align)</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#tables-intro">
 7         <meta name="flags" content="HTMLonly">
 8         <meta name="assert" content="'vertical-align' can be set on table cells (example from section 17.1).">
 9         <style type="text/css">
10             caption
11             {
12                 color: blue;
13             }
14             td
15             {
16                 border: 1px solid blue;
17                 height: 5em;
18                 vertical-align: middle;
19                 width: 10em;
20             }
21             th
22             {
23                 border: 1px solid blue;
24                 height: 5em;
25                 vertical-align: baseline;
26                 width: 10em;
27              }
28         </style>
29     </head>
30     <body>
31         <p>Test passes if the text in the left-most box column is at the very top of the column and text in the other two columns is vertically centered.</p>
32         <table>
33             <caption>This is a simple 3x3 table</caption>
34             <tr id="row1">
35                 <th>Header 1</th>
36                 <td>Cell 1</td>
37                 <td>Cell 2</td>
38             </tr>
39             <tr id="row2">
40                 <th>Header 2</th>
41                 <td>Cell 3</td>
42                 <td>Cell 4</td>
43             </tr>
44             <tr id="row3">
45                 <th>Header 3</th>
46                 <td>Cell 5</td>
47                 <td>Cell 6</td>
48             </tr>
49         </table>
50     </body>
51  </html>