tags:

views:

201

answers:

1

JQgrid outputs this html for a left aligned cell - but it is too hard to the left and touches the grid lines:

<td title="P-1" class="grid-text" style="text-align: left; width: 92px;" 
    role="gridcell">some text content</td>

How can I style that so that there is a little bit space on the left hand side?

I have tried:

.grid-text {
    text-align: left;
    margin-left: 4px; // padding-left didnt work either
}

But it is still hard to the left.

And on the other side, right aligned text also has the same problem: hard against the right and touching the grid line

<td title="1.37" class="grid-number" style="text-align: right; width: 55px;"
    role="gridcell">1.37</td>

And finally, when editing inline the input box also is hard to the right and touches the lines:

<td title="14.00" class="grid-number" style="text-align: right;" role="gridcell">
    <input type="text" style="width: 98%;" maxlength="20" id="2_qty" name="qty" 
           class="editable"></td>

Is there anything I can do to fix this? Preferably with a nice little bit of CSS?

+1  A: 

Have you tried adding !important to your padding-left?

Do you have a page we can look at?

Kerry
I did try !important - but it must have been at the same time I was trying margin-left. "padding-left: 1px !important" seems to have worked, just checking all my grids now
JK
Thanks looks good, and seems to work in all browsers too (grid lines are a few px off in IE7, but that might be a different issue). Accepted answer, nice and easy fix.
JK
Good! Glad it worked, and you might want to use a CSS hack for IE7: http://webdevelopment.kerryjones.net/css/browser-specific-css/
Kerry