Do not do it that way. Style's should always be in a separate CSS document - it's better that way any way you look at it.
GWT is not mixing content with style I don't think. How you would write the equivalent HTML? <table class="stocksFlexTable"> </table> (that's not the element FlexTable uses, but this is for demonstration purposes only). If you don't specify the class, how is the CSS supposed to realize which particular table you wanted to style? The variable name is just a javascript variable - has absolutely no relation to CSS. The addStyleName simply modifies the class attribute (so that you can style it with CSS as you want). If you don't like that, you could always do getElement().setId("") (but remember that id uniquely identifies an element) AFAIK, mixing content with style is a different problem where, for instance, elements in HTML used to represent both the visual style & the document structure. Am I completely wrong? On Thu, Mar 19, 2009 at 2:16 PM, Danny Schimke <schimk...@googlemail.com>wrote: > You could do something like this: > > Style style = tmpElement.getElement().getStyle(); > style.setProperty("border", "1py solid #000000;"); > > -Danny > > 2009/3/19 Coonay <fla...@gmail.com> > > >> like old html,gwt mix content with style again? >> in gwt ,most dynamic UI element have to set style with addStyleName >> method? >> such as the following, >> public class FirstGWT implements EntryPoint { >> private FlexTable stocksFlexTable = new FlexTable(); >> } >> >> if i define the style in the css >> . stocksFlexTable { >> } >> >> can gwt apply this to stocksFlexTable automatically without manually >> calling addStyleName? >> >> > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---