resizing a slickgrid column header causes it to be misaligned with body

偶尔善良 提交于 2019-12-04 19:46:00

I was solve this problem by putting slickgrid's div in div with display:table style like this:

<div style="display:table;">
    <div id="grid1"></div>
</div>

But before I found solutions: for css:

[class^="slickgrid_"],
[class^="slickgrid_"] div {
    -webkit-box-sizing: content-box !important;
    -moz-box-sizing: content-box !important;
     box-sizing: content-box !important;
}

for script block:

grid1 = new Slick.Grid("#grid1", data, columns, options);

and also I use for dependency at end of code:

grid1.autosizeColumns();

Also I found that this issue is when I use

<center> <center> 

tags arround div

It's most likely because bootstrap 3 uses box-sizing: border-box. You'll need to reset the .slick-headers and related slick header/column elements to use box-sizing: content-box

Also - the pull request you mentioned fixes the same issue but it has not been approved/merged in the actual slick grid code.

Thanks, I was also having issues in Firefox (only) where the header columns where misaligned with the body of the grid. This post helped resolved my issue. I'm using slick.grid.css , and as the previous post suggests. I added:

   -moz-box-sizing: border-box;
   box-sizing: border-box;

to: .slick-header-columns, .slick-headerrow-columns .slick-header-column.ui-state-default

HTH

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!