jqGrid column not aligned with column headers

有些话、适合烂在心里 提交于 2020-01-13 19:15:28

问题


I'm using jqGrid 3.6.5 and IE8

When setting shrinkToFit: false the columns are clearly not aligned with the column headers.
If I turn on shrinkToFit: true the problem disappears, but I lose the absolute sizing of the columns.
Resizing the columns (in code, or dynamically by the user) does not affect this problem.

See image for illustration

alt text http://www.freeimagehosting.net/uploads/274ab94e4d.png


回答1:


The alignment of the column headers are per default always 'center' and independ on the 'align' option from the ColModel (see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:colmodel_options).

You can change the alignment of the column headers with the method which I describe3d in Jquery JQGrid - How to set alignment of grid header cells?.

I cann't reproduce the problem with shrinkToFit: false which you descrbed in your question. Which version of jqGrid you use? If you post a code example which reproduce the problem I could try to help you.

P.S. Probably the CSS which you use in your example could be also important. If you change table margins you should also change cellLayout parameter of jqGrid.




回答2:


As you can see from my original image (in the question), I have no borders between cell columns. I used border-right-color: none
This seems to be the reason. I changed it instead to border-right-color: White (to match the border with the background color), and the columns are now perfectly aligned with the column headers.

This might have been some issue with IE specifically, since it worked correctly on Chrome even before the change.



来源:https://stackoverflow.com/questions/3233038/jqgrid-column-not-aligned-with-column-headers

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