微件:Sandbox:修订间差异
跳转到导航
跳转到搜索
无编辑摘要 |
无编辑摘要 |
||
第1行: | 第1行: | ||
<includeonly><p>payload</p> | <includeonly><script> | ||
window.onscroll = function() { | |||
var tables = document.getElementsByClassName("fixed-header-table"); | |||
var hdr = document.getElementById('fixed-table-header'); | |||
for (var i = 0; i < tables.length; ++i) { | |||
var table = tables[i]; | |||
var rect = table.getBoundingClientRect(); | |||
if (rect.top < 0 && rect.bottom > 0) { | |||
if (hdr == null) { | |||
hdr = table.cloneNode(true); | |||
hdr.id = 'fixed-table-header'; | |||
hdr.style.position = 'fixed'; | |||
hdr.style.pointerEvents = 'none'; | |||
hdr.style.top = 0; | |||
hdr.style.width = table.style.width; | |||
table.parentNode.appendChild(hdr); | |||
hdr.style.visibility = 'hidden'; | |||
for (var i = 0; i < hdr.childNodes.length; i++) | |||
if (hdr.childNodes[i].tagName == 'THEAD') { | |||
hdr.childNodes[i].style.visibility = 'visible'; | |||
hdr.childNodes[i].style.pointerEvents = 'auto'; | |||
} | |||
} | |||
return; | |||
} | |||
} | |||
if (hdr != null) hdr.remove(); | |||
} | |||
</script><p>payload</p> | |||
<p>payload</p> | <p>payload</p> | ||
<p>payload</p> | <p>payload</p> | ||
< | <table class="fixed-header-table"> | ||
<thead> <tr> <th>Col1</th> <th>Col2</th> <th>Col3</th> </tr> </thead> | <thead> <tr> <th>Col1</th> <th>Col2</th> <th>Col3</th> </tr> </thead> | ||
<tbody> | <tbody> | ||
第15行: | 第42行: | ||
</tbody> | </tbody> | ||
</table> | </table> | ||
<p>payload</p> | <p>payload</p> | ||
<p>payload</p> | <p>payload</p> | ||
<table class="fixed-header-table"> | |||
<thead> <tr> <th>Col1</th> <th>Col2</th> <th>Col3</th> </tr> </thead> | |||
<tbody> | |||
<tr> <td>info</td> <td>info</td> <td>info</td> </tr> | |||
<tr> <td>info</td> <td>info</td> <td>info</td> </tr> | |||
<tr> <td>info</td> <td>some really long line</td> <td>info</td> </tr> | |||
<tr> <td>info</td> <td>info</td> <td>info</td> </tr> | |||
<tr> <td>info</td> <td>info</td> <td>info</td> </tr> | |||
<tr> <td>info</td> <td>info</td> <td>info</td> </tr> | |||
<tr> <td>info</td> <td>info</td> <td>info</td> </tr> | |||
</tbody> | |||
</table> | |||
<p>payload</p> | <p>payload</p> | ||
<p>payload</p> | <p>payload</p> | ||
<p>payload</p> | <p>payload</p> | ||
</includeonly> | |||