both CellTable.setWidth("100%", true). or css property table-layout:fixed fail

133 views
Skip to first unread message

tong123123

unread,
May 28, 2012, 4:05:41 AM5/28/12
to google-we...@googlegroups.com
I want the topic "Controlling Column Widths" in the link
https://developers.google.com/web-toolkit/doc/latest/DevGuideUiCellTable
and I already set the Celltable table
table.setWidth("100%", true);

I also try to use css property
.tableLayout{
table-layout:fixed;
}

and then set this property to the celltable
table.addStyleName("tableLayout");

but the content still wrap to next line if its content is wider than the column width, how to make it truncate (overflow:hidden) the overflow content?

tong123123

unread,
May 28, 2012, 4:24:04 AM5/28/12
to google-we...@googlegroups.com
I double check the api in
http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/cellview/client/CellTable.html#setTableLayoutFixed%28boolean%29
it said
Fixed Table Layout
When using the fixed table layout, cell contents are truncated as needed
but in my case it will not truncated!!

Thomas Broyer

unread,
May 28, 2012, 4:34:35 AM5/28/12
to google-we...@googlegroups.com
If the content can be wrapped, it will be wrapped; otherwise it'll be truncated rather than causing the column to be wider.
If you want your text to be kept on a single line, then use "white-space: nowrap".

tong123123

unread,
May 28, 2012, 5:02:21 AM5/28/12
to google-we...@googlegroups.com
Thanks for the reply.
Finally I use the css
.ellipsis td{
   white-space:nowrap;
   overflow:hidden;
   text-overflow:ellipsis;
}

the ellipsis cannot be shown on IE8, but at least the content kept on a single line and the overflow content is hidden.
but I still have one thing no understand in gwt css file, it always has something like
.gwt-RichTextToolbar .gwt-PushButton-up{
   ......
}

what does it means?
is it normal css syntax or gwt specific?
Reply all
Reply to author
Forward
0 new messages