簡體   English   中英

底部屏幕上的Primefaces數據表分頁

[英]Primefaces datatable pagination on bottom screen

我有數據表,顯示我來自數據庫的數據。 我將分頁添加到數據表的“底部”位置。 我的代碼:

<p:dataTable var="item" id="initemList" widgetVar="initemList" value="#{initemController.initems}"
                 paginator="true" rows="50" reflow="true"
                 paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {CurrentPageReport}"
                 currentPageReportTemplate="{startRecord} - {endRecord} of {totalRecords}" paginatorPosition="bottom"
                 rowsPerPageTemplate="10,25,50" selectionMode="single" scrollable="true"
                 selection="#{initemController.selectedInitem}" rowKey="#{item.itemid}">

結果,這是我的數據表: 在此處輸入圖片說明

我的分頁不是在底部屏幕上,而是在我的數據下面。 我該如何實現?

這是樣式問題。 使用瀏覽器開發人員工具(大多數瀏覽器中為F12 )選擇要設置樣式的節點。 在Chrome中,您還可以右鍵單擊該節點,然后選擇“檢查”。

現在找到創建自定義CSS規則所需的類。 在您的情況下: ui-paginator-bottom

然后創建一些自定義樣式。 根據您的模板,您可能會得到類似以下內容的結果:

.ui-paginator-bottom {
    position: fixed;
    bottom: 0;
}

也可以看看:

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM