gpt4 book ai didi

javascript - 为什么 Handsontable 会这样显示标题?

转载 作者:行者123 更新时间:2023-11-30 12:37:08 25 4
gpt4 key购买 nike

enter image description here

我所做的只是

$('#dataTable').handsontable(
{rows: 2, cols: 1, colHeaders: ['Parameter'], minSpareRows: 1}
);

为什么标题显示为 1 和下面的部分?

最佳答案

我能够在 this fiddle here 中快速重现问题.复制后,我意识到您的问题可能是忘记包含样式表。我更新并包含了这个丢失的样式表,最后得到了 this fiddle (这样可行)。样式包括看起来像:

<link rel="stylesheet" href="http://handsontable.com/dist/jquery.handsontable.full.css">

当然,您可以下载 css 文件并从相对路径包含它,这也可以。希望这能让你走上正轨。祝你好运!

根据下面的评论 - 这里的主要问题可能不是样式未包含在内,而是它已被覆盖。没有过多地了解 handson 表的杂草,它似乎有一个实际的数据表,然后编辑单元格放在它上面(通过 position: absolute)。为了设置编辑单元格的样式,请使用适当的 .ht_clone 类。为了设置“静态”表的样式,请使用 .ht_master 类。下面的代码展示了如何做到这一点:

/* hide the static table header */
.ht_master th {
display: none;
}

/* hide the editing for the header ("clone_top") */
.ht_clone_top {
display: none;
}

JSFiddle here 中查看此工作.希望对您有所帮助!

关于javascript - 为什么 Handsontable 会这样显示标题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25744260/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com