3

I am trying to set a cellpadding value for my vertical panel. There is an API to set cellspacing (CellPanel.setSpacing()) but none for setting the cellpadding.

How do I go about doing this?

Kasturi
  • 3,335
  • 3
  • 28
  • 42

2 Answers2

4

I did it like this:

myVerticalPanel.getElement().setAttribute("cellpadding", "5");

Carnell's answer does not work for IE7 and earlier versions.

Perdi Estaquel
  • 819
  • 1
  • 6
  • 21
1

You should use css to do this. Refer to the dev guide. Basically you want to set a style name on the panel using one of the setStyle* methods. Once you do this you use css to apply the styles for the particular name.

Carnell
  • 749
  • 6
  • 10
  • 1
    cellpadding is a Element attribute not a style attribute. – Kasturi May 06 '10 at 15:49
  • 1
    http://stackoverflow.com/questions/339923/how-to-set-cellpadding-cellspacing-in-css has examples of setting things like th, td { padding: 0 } to accomplish this once you've applied a style as Carnell suggested. – aem May 06 '10 at 21:27