Here I am adding three widgets to a HorizontalPanel, a button, a label
and another button.   The alignments should go right, center, left,
respectively.  Also below is an effort to style these cells (which I
know won't work becuase of the align property on the cells).


                buttonPanel.setStyleName("buttonPanel");

                Button upButton = new Button("UP");
                upButton.addClickListener(new ClickListener() {
                        public void onClick(Widget sender) {
                        }
                });

                buttonPanel.setCellHorizontalAlignment(upButton,
HasHorizontalAlignment.ALIGN_RIGHT);
                buttonPanel.add(upButton);

                buttonPanel.add(new Label("   "));

                Button downButton = new Button("DN");
                downButton.addClickListener(new ClickListener() {
                        public void onClick(Widget sender) {
                        }
                });
                buttonPanel.setCellHorizontalAlignment(downButton,
HasHorizontalAlignment.ALIGN_LEFT);
                buttonPanel.add(downButton);

CSS:

.buttonPanel tr td:first-child + td + td {
        text-align: left; width: 100px
}

.buttonPanel tr td:first-child + td {
        text-align: center; width: 100px
}
.buttonPanel tr td:first-child {
        text-align: right; width: 100px
}

On Apr 18, 4:12 am, Salvador Diaz <[email protected]> wrote:
> You might want to check the javadoc:
>
> http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/g...)
>
> this method changes the align attribute value on the tds, try it out
> and look at the source code for it, it will give you some nice
> insights into what's going on behind the scenes ;)
>
> Cheers,
>
> Salvador
>
> On Apr 17, 10:49 pm,badgerduke<[email protected]> wrote:
>
> > Hello:
>
> > I am working with a HorizontalPanel and trying to style the generated
> > table cells.  GWT automatically inserts "align=left" on the tds,
> > making it impossible to style this property.
>
> > Now I 've been trying to use:
>
> > buttonPanel.setCellHorizontalAlignment(upButton,
> > HorizontalPanel.ALIGN_RIGHT);
>
> > with "upButton" being a Button within the cell and "buttonPanel" being
> > the HorizontalPanel, but this has no effect on the outcome.  Can
> > anybody give me a hand?
>
> > Thanks
> > Eric
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to