Styling rows in CellTable

68 views
Skip to first unread message

frank

unread,
Jan 15, 2011, 12:43:02 PM1/15/11
to Google Web Toolkit
Hi,

I tried to stye a row in a Celltable with .setRowStyles in which I add
the class "SERVERROUNDTRIP"

I can find the new attached class in the generated html output.
<tr onclick="" class="GL0PBETBED SERVERROUNDTRIP">

The Problem is, in the generated HTML file there is a <style> Element
after the included CSS files which overroules my class with a selector
for the class "GL0PBETBED" which is generated by GWT.

Any ideas or am I totally an the wrong way?
Thanks

Thomas Broyer

unread,
Jan 15, 2011, 4:40:00 PM1/15/11
to google-we...@googlegroups.com
If CellTable's default styles get in your way, you'll have to replace them with yours: create an interface extending CellTable.Resources and override the cellTableStyle() method to assign it a new @Source in which you'll put your own styles. Then, GWT.create() that new interface and give it to CellTable's constructor.

John LaBanca

unread,
Jan 15, 2011, 6:47:35 PM1/15/11
to google-we...@googlegroups.com
Alternatively, you can add !important to you CSS styles to ensure they take precedence.

.myStyle {
  backgound: blue !important; // Takes precedence because it is important
}
.myStyle {
  backgound: red;
}
.myStyle {
  backgound: green; // Takes precedence over red because it appears after, but blue still take precedence over green
}

Thanks,
John LaBanca
jlab...@google.com


On Sat, Jan 15, 2011 at 4:40 PM, Thomas Broyer <t.br...@gmail.com> wrote:
If CellTable's default styles get in your way, you'll have to replace them with yours: create an interface extending CellTable.Resources and override the cellTableStyle() method to assign it a new @Source in which you'll put your own styles. Then, GWT.create() that new interface and give it to CellTable's constructor.

--
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-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

frank

unread,
Jan 16, 2011, 6:45:09 PM1/16/11
to Google Web Toolkit
Thanks, I´ll try both methods

Frank
Reply all
Reply to author
Forward
0 new messages