table-caption-optional-002

Inline-tables with and without the optional caption

WeasyPrint

This browser

Flags
may
Assertion
A caption on an inline-table is optional - an inline table can be rendered with or without it.

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: Inline-tables with and without the optional caption</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#table-display">
 7         <meta name="flags" content="may">
 8         <meta name="assert" content="A caption on an inline-table is optional - an inline table can be rendered with or without it.">
 9         <style type="text/css">
10             .table
11             {
12                 display: inline-table;
13             }
14             .caption
15             {
16                 display: table-caption;
17             }
18             .tr
19             {
20                 display: table-row;
21             }
22             .td
23             {
24                 background: black;
25                 display: table-cell;
26                 height: 50px;
27                 width: 50px;
28             }
29         </style>
30     </head>
31     <body>
32         <p>Test passes if the left square below has "Filler Text" directly above it and the square on the right does not.</p>
33         <div>
34             <span class="table">
35                 <span class="caption">Filler Text</span>
36                 <span class="tr">
37                     <span class="td"></span>
38                     <span class="td"></span>
39                 </span>
40                 <span class="tr">
41                     <span class="td"></span>
42                     <span class="td"></span>
43                 </span>
44             </span>
45             &nbsp;&nbsp;
46             <span class="table">
47                 <span class="tr">
48                     <span class="td"></span>
49                     <span class="td"></span>
50                 </span>
51                 <span class="tr">
52                     <span class="td"></span>
53                     <span class="td"></span>
54                 </span>
55             </span>
56         </div>
57     </body>
58  </html>