Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Wrapping of content in a table

Jamie Craane
1 decade ago Apr 27, 2010 12:49pm
Dmitri Livotov
1 decade ago Apr 27, 2010 1:26pm
Jamie Craane
1 decade ago Apr 28, 2010 6:18am

Hi Dmitri,

Thanks for your answer. I did not follow you suggestions exactly but here is an example of how I made the text wrap in a table column:

public void init() {
		Window mainWindow = new Window("Test Application");
		Table table = new Table();
		table.setColumnWidth("title", 55);
		table.setColumnExpandRatio("description", 1);
		table.setContainerDataSource(new BeanItemContainer<Person>(createTestData()));
		table.setVisibleColumns(new String[] { "name", "description" });

I explicitly set the width of the first column to 55 and gave the second column an expandratio of 1. I also added the following css declaration to my custom theme named mytheme:

@import url(../runo/styles.css);

.v-table-cell-wrapper {
	white-space: normal;

Now, the text wraps nicely when you resize the table.


George Smith
10 years ago Jan 21, 2013 3:39pm

Вот на эту


часть кода пишет:

WARNING: File D:\liferay\liferay-plugins-sdk-6.1.1\portlets\stepVaadin-portlet\docroot\WEB-INF\VAADIN\themes\mytheme/../reindeer/styles.css does not exist

mytheme создал в проекте WEB-INF/VAADIN/themes/mytheme в ней свой файл styles.css в котором указанный тобой код. В init() написал


и нихрена не переносится. Ворнинг должен быть или нет? Или надо весь путь от диска писать или какие еще могут быть проблемы?

Riley Pickerl
9 years ago Aug 09, 2013 4:29pm
Christian Wahl
9 years ago Aug 30, 2013 7:29am
li huan
6 years ago Jun 23, 2016 12:09pm