【问题标题】:Fix rows in html table exported from excel修复从 excel 导出的 html 表中的行
【发布时间】:2019-11-23 00:02:52
【问题描述】:

下面是从 excel 宏导出的表格的 html 代码。现在我想在滚动时修复它的标题,因为表格中会有很多行。任何方式来做到这一点。

我尝试使用 position:fixed 进行行,但它只是弄乱了表格布局。

请帮忙。

https://jsfiddle.net/samadhan10/8ya5rg7k/

我尝试了here 的解决方案,但单元格对齐搞砸了。

https://jsfiddle.net/samadhan10/ogavsejm/1/

【问题讨论】:

  • 您需要使用一个 jQuery 插件来修复表头。有很多可用的。
  • 好的,我试试看。

标签: javascript jquery html css


【解决方案1】:

我通过在 html 页面中分别导出数据和标题行来解决它。然后修改具有标题的文件并将它们添加到固定的div中:

<div  position="fixed">
...
</div>

使用iframe嵌入数据文件:

<div>
   <iframe src="data.html" marginwidth="60" width="1244" height="1500" align="center"> 
   </iframe>
</div>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-13
    • 1970-01-01
    相关资源
    最近更新 更多