Javascript 试图冻结列时,列重叠

Javascript 试图冻结列时,列重叠,javascript,html,css,html-table,Javascript,Html,Css,Html Table,在下面的代码中,它与最初的两列重叠。如果删除绝对值 然后它看起来是正确的,但无法冻结列。 如何将其更正为冻结第一列 .f-sticky-col { position:absolute; width:100px; } 识别号 名称 别名 价值 夸脱 领域 字段2 字段3 字段4 字段5 字段6 字段7 字段8 字段9 字段10 文本 123456789 文本1 文本2 文本3 文本4 文本5 文本6 文本7 8. 文本9 10 11 12 13 您

在下面的代码中,它与最初的两列重叠。如果删除
绝对值
然后它看起来是正确的,但无法冻结列。 如何将其更正为冻结第一列

    .f-sticky-col {
    position:absolute;
      width:100px;
        }

识别号
名称
别名
价值
夸脱
领域
字段2
字段3
字段4
字段5
字段6
字段7
字段8
字段9
字段10
文本
123456789
文本1
文本2
文本3
文本4
文本5
文本6
文本7
8.
文本9
10
11
12
13

您可以通过稍微更改css来实现这一点。使用下面的css。同时删除表格标记中的width=“100%”,因为表格宽度在css中设置为1600px

<style>
.f-sticky-col {
position:absolute;
top:5px; /* specify a value otherwise it behaves like auto */
left:5px; /* specify a value */
}

.table-responsive {
overflow-x: scroll;
margin-left: 100px; /* The margin moves the cell over so not to overlap the absolute positioned column */
}

table { /* set the width of the table to the sum of the widths of the row */
1600px;
}

td, th { /* set the table cells and header cells width so they display evenly */
width: 100px;
}
</style>

.f-col{
位置:绝对位置;
top:5px;/*指定一个值,否则其行为类似于自动*/
左:5px;/*指定一个值*/
}
.表格响应{
溢出-x:滚动;
左边距:100px;/*边距将单元格移到上方,以避免与绝对定位列重叠*/
}
表{/*将表的宽度设置为行的宽度之和*/
1600px;
}
td,th{/*设置表格单元格和标题单元格的宽度,以便它们均匀显示*/
宽度:100px;
}

为什么要投反对票。