我在表中有一个文本区域,并设置
.v-textarea区域{字-换行:断字;}
在css中。而且没有其他样式可以覆盖它。但这似乎行不通。还有别的事情要做吗?还是我做错什么了?
发布于 2011-10-19 12:14:47
Vaadin表有两种状态:可编辑状态和“正常状态”。据我所知,您只为处于可编辑状态的表设置CSS样式,而不应该为您的表添加“正常”状态的另一种样式。
.v-table-cell-content .v-table-cell-break-word{
word-wrap: break-word;
}如果只为特定列设置此样式,请使用以下命令:
table.setCellStyleGenerator(new CellStyleGenerator() {
public String getStyle(Object itemId, Object propertyId) {
if (propertyId == null){
return null;
}
if (propertyId.equals("your.column.name")) {
// style the generated email column
return "break-word";
}
}};有关更多信息,您可以看到这个小管。
https://stackoverflow.com/questions/7807927
复制相似问题