CellTables and css

469 views
Skip to first unread message

Tony Kennah

unread,
Sep 9, 2011, 8:33:54 PM9/9/11
to Google Web Toolkit
Hi

Could someone help me in setting the background of a CellTable row
please, I've been trying all night to do it and keep failing and it's
driving me mad. I tried using a call to "setRowStyles()" but that
doesn't seem to be working and I've read that you can't change the
style for a CellTable once a style has been set - as the default one
is being set.

Then I tried constructing a CellTable with my own interface
CellTableResources as seen on a post on this exact subject BUT that
gave me error messages about unobfuscated ccs elements.... which my
css not being obfuscated is an obvious error message.

Now I don't know what to try and I am officially STUCK.

TonyK

Sudhakar Abraham

unread,
Sep 10, 2011, 2:53:48 AM9/10/11
to Google Web Toolkit
Change the default celltable properties ".cellTableEvenRow
",".cellTableOddRow" of cellTableStyle.css file. Copy and paste
CellTableStyle.css file in your project directory. Use the
CellTable.Resources interface and specify the @source of celltable in
your celltable class.

S. Abraham
www.DataStoreGwt.com

interface TableResources extends CellTable.Resources
{
@Source(value = { CellTable.Style.DEFAULT_CSS,
"CellTableStyle.css" })
CellTable.Style cellTableStyle();
}
CellTable studentTable = new CellTable<Student>(15,
GWT.<TableResources> create(TableResources.class));

CellTableStyle.css file.

.cellTableCell {
height: 25px;
padding: 2px 25px;
}

.cellTableHeader {
height: 25px;
border-bottom: 2px solid #60a6bf;
padding: 3px 25px;
text-align: left;
color: blue;
text-shadow: #ddf 1px 1px 0;
overflow: hidden;
cursor:pointer;
background-image: url(bollon.gif);
background-repeat:no-repeat;
background-position:80% 50%;

}

.cellTableEvenRow {
background: #fffaf0;
border:solid 1px red;
}

.cellTableEvenRowCell {
border:solid 1px green;
}

.cellTableOddRow {
background: #fff8e8;
}

.cellTableOddRowCell {
border:solid 1px red;

Tony Kennah

unread,
Sep 12, 2011, 8:08:21 AM9/12/11
to Google Web Toolkit
Thanks that's brilliant it working :) - Stage 1 complete

Again thanks!

PS (my nearly the same but somehow different CellTable issue...(more
specific))
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/7997211b49d8210f#
Reply all
Reply to author
Forward
0 new messages