下面是从 excel 宏导出的表格的 html 代码。现在我想在滚动时修复它的标题,因为表格中会有很多行。任何方式来做到这一点。
我尝试对行使用 position:fixed
,但它只会弄乱表格布局。
请帮忙。
https://jsfiddle.net/samadhan10/8ya5rg7k/
我尝试了 here 的解决方案但单元格排列困惑。
最佳答案
我通过在 html 页面中分别导出数据和标题行来解决它。然后修改带有header的文件并将它们添加到一个固定的div中:
<div position="fixed">
...
</div>
使用 iframe
嵌入数据文件:
<div>
<iframe src="data.html" marginwidth="60" width="1244" height="1500" align="center">
</iframe>
</div>
关于javascript - 修复从 excel 导出的 html 表中的行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57020189/