Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2515
Removing all padding from igGrid cell
posted

I need to be able to fill a particular column of an igGrid with a specific background color and have no padding. I don't want to affect any other columns.

In the dataRendered event I have tried the following (plus many more), but I still have padding around my cell content. How do I remove all padding?

ui.owner.element.find("tr td:nth-child(2)").css("padding", 0);

ui.owner.element.find("tr td:nth-child(2)").css("background-color", "red");

Parents
No Data
Reply
  • 18204
    Suggested Answer
    Offline posted

    Hello hrwebb,

    Thank you for posting in our forums!

    I have a few questions about this.  First, do you have any additional CSS on the page that may be interfering with this somehow?

    And second, are you sure you are seeing padding and not the margins or the border?  I have put together a quick jsFiddle here using the code you provided and the only thing I notice is the horizontal border between the cells.  If this is the same result you are seeing, you can comment out the line in my dataRendered handler to remove the border.

    Please check out my fiddle and let me know what may be different with your page.  And feel free to modify the fiddle and update me, or provide your own sample that reproduces the issue.

    Looking forward to hearing from you.

Children