Gwt 我们能让celltable的列水平流动而不是垂直流动吗?

Gwt 我们能让celltable的列水平流动而不是垂直流动吗?,gwt,gwtp,Gwt,Gwtp,好的,这是我的问题,因为空间有限,我想让我的celltable有1列命名页面水平流动 传统上,1列单元格表如下所示: Page 1 2 3 .... 我想让它看起来像这样 Page 1 2 3 ...... 如何做到这一点?不要使用celltable,而是自定义CellList,这样就可以了 public class HorizontalCellList<T> extends CellList<T> { public HorizontalCellList(Cell&

好的,这是我的问题,因为空间有限,我想让我的celltable有1列命名页面水平流动

传统上,1列单元格表如下所示:

Page 1 2 3 .... 我想让它看起来像这样

Page 1 2 3 ......
如何做到这一点?

不要使用celltable,而是自定义CellList,这样就可以了

public class HorizontalCellList<T> extends CellList<T> {

  public HorizontalCellList(Cell<T> cell) {
    super(cell);
  }

  @Override
  protected void renderRowValues(
      SafeHtmlBuilder sb, List<T> values, int start, SelectionModel<? super T> selectionModel) {
    SafeHtmlBuilder filteredSB = new SafeHtmlBuilder();
    super.renderRowValues(filteredSB, values, start, selectionModel);
    SafeHtml safeHtml = filteredSB.toSafeHtml();
    String filtered = safeHtml.asString().replaceAll("<div", "<span").replaceAll("div>","span>");
    sb.append(SafeHtmlUtils.fromTrustedString(filtered));
  }
}

字符串替换是对内联元素进行更改的一种稍微可怕的方式——考虑使用CSS来调整它们的类来调整那些特定的div元素,很可能不显示:内联或浮点:左边,而不是用正则表达式重写HTML。我尝试了{.horizontalCellList{display:inline;}但是它不起作用?你能提供你的代码吗?不要将它应用于整个单元格列表,而是应用于单元格本身。要使单元格列表能够使用它,你需要构建一个clientbundle,扩展单元格列表自己的clientbundle,并在.CellListEventItem和.cellListOddItem样式上添加更多css,因为没有其他样式添加到项目本身。