Programmatically margin auto

610 views
Skip to first unread message

davi...@gmail.com

unread,
Jun 10, 2012, 4:05:34 PM6/10/12
to Google Web Toolkit

Hi,

I need programmatically to set the margin of a html Element.

I have found the method:

gwtElement.getStyle().setMarginLeft(px, Unit.PX);

But if I like to set the margin left to auto how is possible by code?

Thanks in advance for any help!

Jens

unread,
Jun 10, 2012, 4:26:25 PM6/10/12
to google-we...@googlegroups.com
Hi,

getElement().getStyle().setProperty("marginLeft", "auto");

should work.

-- J.
Reply all
Reply to author
Forward
0 new messages