elachell
elachell

Reputation: 2677

How to have one line per row in a cellTable?

I am using a CellTable on a ScrollPanel in GWT. My table has two columns and I want to give 10% and 90% of the width each. This is fine.

The problem is that I want to have one line of text per row in the table. That is if the content of one cell is too large to be showed in one line, I want to have either a horizontal scrolling bar or just truncate the text to fit it in one line.

Here is an extract of my code:

cellTable.addColumn(column1);
cellTable.addColumn(column2);
cellTable.setWidth("100%", true);
cellTable.setColumnWidth(column1, 10.0, Unit.PCT);
cellTable.setColumnWidth(column2, 90.0, Unit.PCT);

I also tried to use:

cellTable.setTableLayoutFixed(true);

but it doesn't change the layout.

Thanks a lot for your comments!

Upvotes: 1

Views: 1715

Answers (2)

nogridbag
nogridbag

Reputation: 3703

Use the CSS property "white-space: nowrap"

More info

Upvotes: 1

Thomas Broyer
Thomas Broyer

Reputation: 64541

You'll have to play with the word-wrap, overflow and possibly text-overflow CSS properties.

Upvotes: 0

Related Questions