自动换行:在瓦丁语中使用破解词

时间:2011-10-18 13:25:13

标签: css vaadin word-wrap

我在表格中有一个textarea,然后设置

  

.V-textarea的{       自动换行:break-word; }

在css中。并且没有其他样式覆盖它。但它似乎无法正常工作。还有什么可以打破工作?或者我做错了什么?

1 个答案:

答案 0 :(得分:1)

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";
 }
}};

有关详细信息,请参阅this tutotial

相关问题