0
好的,這裏是我的問題,因爲空間有限,我想讓我的celltable(有1列命名頁)水平流動。我們可以使水平流動列而不是垂直流動嗎?
傳統上,1列celltable這個樣子的:
Page 1 2 3 ....
我想使它看起來像這樣。
Page 1 2 3 ......
該怎麼做?
好的,這裏是我的問題,因爲空間有限,我想讓我的celltable(有1列命名頁)水平流動。我們可以使水平流動列而不是垂直流動嗎?
傳統上,1列celltable這個樣子的:
Page 1 2 3 ....
我想使它看起來像這樣。
Page 1 2 3 ......
該怎麼做?
不要使用celltable,但custome 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元素(由他們的類,可能不是)「display:inline」或「float:left」,而不是用* regex *重寫* html *。 –
你有沒有測試你的代碼?我試過{.horizontalCellList { display:inline; }但它不工作?你能提供你的代碼嗎? – Tum
不要將其應用於整個單元格列表 - 將其應用於單元格本身。爲了使CellList能夠與它一起工作,你需要構建一個擴展CellList自己的clientbundle的clientbundle,並且添加更多的css(可能在'.cellListEvenItem'和'.cellListOddItem'樣式中,因爲沒有其他樣式被添加到項目本身)。 –