On Thu, 2012-08-23 at 12:15 -0700, Daniel Gonzalez wrote:
> Hi,
>
>
> I need to specify the width of the <td> container of an
> HorizontalPanel. I add the elements doing the usual ".add(widget)".
> How can I specify the width of the <td>?
>
Hi, Daniel
HorizontalPanel descends from CellPanel.
CellPanel has a setCellWidth method, which looks like
def setCellWidth(self, widget, width):
td = DOM.getParent(widget.getElement())
if width is None:
DOM.removeAttribute(td, "width")
else:
DOM.setAttribute(td, "width", str(width))
so, after you hp.add(widget)
you can, for example,
hp.setCellWidth(widget, 30)
Note that this is using HTML TABLE's TD tag "width" attribute, not css.
- Jim Washington
--