table-columns-example-002

Table columns - Assigning a background to a column

WeasyPrint

This browser

Assertion
A specific column class can be selected for a blue background (example from section 17.3).

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: Table columns - Assigning a background to a column</title>
 5         <link rel="author" title="W3C" href="http://www.w3c.org">
 6         <link rel="author" title="Microsoft" href="http://www.microsoft.com/">
 7         <link rel="help" href="http://www.w3.org/TR/CSS21/tables.html#columns">
 8         <meta name="flags" content="">
 9         <meta name="assert" content="A specific column class can be selected for a blue background (example from section 17.3).">
10         <style type="text/css">
11             table
12             {
13                 border-collapse: collapse;
14             }
15             col
16             {
17                 border-style: solid;
18             }
19             col.totals
20             {
21                 background: blue;
22             }
23             td
24             {
25                 border: 1px solid black;
26                 height: 2em;
27                 width: 2em;
28             }
29         </style>
30     </head>
31     <body>
32         <p>Test passes if the middle column of the three-by-three grid is blue.</p>
33         <table>
34             <col>
35             <col class="totals">
36             <col>
37             <tr>
38                 <td></td>
39                 <td></td>
40                 <td></td>
41             </tr>
42             <tr>
43                 <td></td>
44                 <td></td>
45                 <td></td>
46             </tr>
47             <tr>
48                 <td></td>
49                 <td></td>
50                 <td></td>
51             </tr>
52         </table>
53     </body>
54 </html>