jqGrid: how to change cell padding

Posted by Maurice on Stack Overflow See other posts from Stack Overflow or by Maurice
Published on 2010-06-10T14:13:35Z Indexed on 2010/06/10 14:23 UTC
Read the original article Hit count: 798

Filed under:
|
|
|

Hi,

I'm using jqGrid3.6.5 on google hosted jQueryUI1.8.2 and jQuery1.4.2

I want to change the cell padding of a jqGrid. For testing purposes I want to set it to 10px all around each cell.

The only option I've come across while googling is the following:

  1. add padding with CSS. eg. #grid-id td{ padding:10px; }
  2. set cellLayout option to 21 (paddingleft + paddingright + borderleft)

When I have no set width on any of the columns in my colModel, this works like expected. Though when I resize one of the headers, or set a column width in the colModel, headers and cells aren't aligned anymore.

Anyone know how to fix this or know an alternative way to alter cell padding?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery