1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html lang="en">
3 <head>
4 <title>CSS Test: Table layout: checking dynamic layouts match initial layouts</title>
5 <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch">
6 <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/table/dynamic/002.html" type="text/html">
7 <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#margin-properties">
8 <meta name="flags" content="dom">
9 <style type="text/css">
10 table { font-size: 4em; position: absolute; margin-top: 1em; }
11 td { border: solid; }
12 .control { color: red; }
13 .control div { margin-top: 50%; margin-left: -10%; }
14 .test { color: green; }
15 </style>
16 <script type="text/javascript">
17 function test() {
18 var element = document.getElementById('test');
19 element.style.marginTop = "50%";
20 element.style.marginLeft = "-10%";
21 }
22 </script>
23 </head>
24 <body onload="setTimeout(test, 0)">
25 <p>There should be no red below, only green boxes with snowflakes in them.</p>
26 <table class="control">
27 <tr>
28 <td>
29 ❃
30 </td>
31 <td>
32 <div>❄</div>
33 </td>
34 <td>
35 ❅
36 </td>
37 </tr>
38 </table>
39 <table class="test">
40 <tr>
41 <td>
42 ❃
43 </td>
44 <td>
45 <div id="test">❄</div>
46 </td>
47 <td>
48 ❅
49 </td>
50 </tr>
51 </table>
52 </body>
53 </html>