小编Mef*_*sov的帖子

表头位置:粘性和边框问题

这篇文章之后,我有一个表格,我正在尝试获取粘性标题。除了我的表格样式的顶部和底部带有边框的标题。

我不明白的部分是顶部/底部边框应用于th与表格的其余部分一起滚动而不是留在“卡住”标题单元格中。有什么可以做的吗?

可以在此处找到工作示例:https : //codepen.io/smlombardi/pen/MNKqQY?editors=1100#0

let string = ''
console.log("oj")
for(let i=0; i<100; i++) {
  string += `
        <tr>
          <td>Malcolm Reynolds</td>
          <td>Captain</td>
          <td>9035749867</td>
          <td>mreynolds</td>
        </tr>
  `
}
document.getElementsByTagName('tbody')[0].innerHTML += string
Run Code Online (Sandbox Code Playgroud)
.table-sticky-container {
  height: 200px;
  overflow-y: scroll;
  border-top: 1px solid green;
  border-bottom: 1px solid green;
}

.table-sticky {

  th {
    position: sticky;
    top: 0;
    z-index: 2;
    border-top: 1px solid red !important;
    border-bottom: 2px solid red !important;
  }
}
Run Code Online (Sandbox Code Playgroud)
<div class="table-sticky-container">
  <table class="table table-sticky">
    <thead class="thead-light">
      <tr> …
Run Code Online (Sandbox Code Playgroud)

html css twitter-bootstrap

24
推荐指数
3
解决办法
1万
查看次数

sklearn 的 SimpleImputer 和 Imputer 的区别

在 python 的sklearn库中有两个类,它们做的事情大致相同: sklearn.preprocessing.Imputersklearn.impute.SimpleImputer

唯一的区别,我发现是"constant" strategy在类型SimpeImputer。还有其他区别吗?什么时候应该ImputerSimpleImputer?

python machine-learning scikit-learn imputation

7
推荐指数
1
解决办法
3708
查看次数