| OLD | NEW |
| 1 <style> | 1 <style> |
| 2 body { | |
| 3 margin: 0; | |
| 4 } | |
| 5 | 2 |
| 6 table { | 3 table { |
| 7 background: red; | |
| 8 border-collapse: collapse; | 4 border-collapse: collapse; |
| 9 } | 5 } |
| 10 | 6 |
| 11 td, th { | 7 td, th { |
| 12 height: 50px; | 8 height: 40px; |
| 13 width: 50px; | 9 width: 40px; |
| 14 padding: 0; | |
| 15 } | 10 } |
| 16 | 11 |
| 17 th { | 12 th { |
| 18 background: green; | 13 background: green; |
| 19 } | 14 } |
| 20 | 15 |
| 21 .scroller { | 16 .scroller { |
| 22 overflow: hidden; /* hide scrollbars */ | 17 overflow: auto; |
| 23 width: 100px; | 18 height: 400px; |
| 24 height: 200px; | |
| 25 outline: 2px solid black; | |
| 26 } | 19 } |
| 27 | 20 |
| 28 .sticky { | 21 .sticky { |
| 29 position: sticky; | 22 position: sticky; |
| 30 top: 25px; | 23 top: 25px; |
| 31 } | 24 } |
| 25 |
| 26 .padding { |
| 27 height: 500px; |
| 28 } |
| 32 </style> | 29 </style> |
| 33 | 30 |
| 34 <script> | 31 <script> |
| 35 if (window.testRunner) | 32 if (window.testRunner) |
| 36 testRunner.waitUntilDone(); | 33 testRunner.waitUntilDone(); |
| 37 | 34 |
| 38 function finishTest() { | 35 function finishTest() { |
| 39 document.querySelector('.scroller').scrollTop = 200; | 36 document.querySelector('.scroller').scrollTop = 200; |
| 40 if (window.testRunner) | 37 if (window.testRunner) |
| 41 testRunner.notifyDone(); | 38 testRunner.notifyDone(); |
| 42 } | 39 } |
| 43 | 40 |
| 44 window.addEventListener('load', function() { | 41 window.addEventListener('load', function() { |
| 45 requestAnimationFrame(function() { | 42 requestAnimationFrame(function() { |
| 46 requestAnimationFrame(finishTest); | 43 requestAnimationFrame(finishTest); |
| 47 }); | 44 }); |
| 48 }); | 45 }); |
| 49 </script> | 46 </script> |
| 50 | 47 |
| 51 <div class="scroller"> | 48 <div class="scroller"> |
| 49 |
| 52 <table> | 50 <table> |
| 53 <thead class="sticky"> | 51 <thead class="sticky"> |
| 54 <tr class="sticky"> | 52 <tr> |
| 55 <th class="sticky"></th> | 53 <th rowspan="2"></th> |
| 54 <th></th> |
| 55 </tr> |
| 56 <tr> |
| 57 <th style="background: fuchsia;"></th> |
| 56 </tr> | 58 </tr> |
| 57 </thead> | 59 </thead> |
| 58 <tbody> | 60 <tbody> |
| 59 <tr><td></td></tr> | 61 <tr><td></td><td></td></tr> |
| 60 <tr><td></td></tr> | 62 <tr><td></td><td></td></tr> |
| 61 <tr><td></td></tr> | 63 <tr><td></td><td></td></tr> |
| 62 <tr><td></td></tr> | 64 <tr><td></td><td></td></tr> |
| 63 <tr><td></td></tr> | 65 <tr><td></td><td></td></tr> |
| 64 <tr><td></td></tr> | 66 <tr><td></td><td></td></tr> |
| 65 <tr><td></td></tr> | 67 <tr><td></td><td></td></tr> |
| 66 <tr><td></td></tr> | 68 <tr><td></td><td></td></tr> |
| 67 <tr><td></td></tr> | |
| 68 </tbody> | 69 </tbody> |
| 69 </table> | 70 </table> |
| 71 |
| 72 <div class="padding"></div> |
| 73 |
| 70 </div> | 74 </div> |
| OLD | NEW |