white-space-nowrap-attribute-001

White-space 'nowrap' vs. 'nowrap' attribute

WeasyPrint

This browser

Assertion
The 'nowrap' attribute and 'white-space: nowrap' assignment behave the same way with respect to white space.

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 2 <html>
 3     <head>
 4         <title>CSS Test: White-space 'nowrap' vs. 'nowrap' attribute</title>
 5         <link rel="author" title="Microsoft" href="http://www.microsoft.com/">
 6         <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#white-space-prop">
 7         <meta name="flags" content="">
 8         <meta name="assert" content="The 'nowrap' attribute and 'white-space: nowrap' assignment behave the same way with respect to white space.">
 9         <style type="text/css">
10             div, td
11             {
12                 width: 2in;
13             }
14             div
15             {
16                 white-space: nowrap;
17             }
18             table
19             {
20                 border-spacing: 0;
21             }
22             td
23             {
24                 padding: 0;
25             }
26        </style>
27     </head>
28     <body>
29         <p>Test passes if the two lines below have the exact same spacing.</p>
30         <div>  The   spacing  on      these         two  sentences need to be the    same!  </div>
31         <table cellspacing="0">
32             <tr>
33                 <td nowrap="nowrap">  The   spacing  on      these         two  sentences need to be the    same!  </td>
34             </tr>
35         </table>
36     </body>
37 </html>