2017-04-11 26 views
0

我有數據表顯示我的數據庫中的數據。我將分頁包含到我的數據表中'底部'的位置。我的代碼:底部屏幕上的Primefaces數據表分頁

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

至於結果,這是我的數據表: enter image description here

我的分頁是不是底部屏幕上,但我下面的數據。我怎麼能做到這一點?

回答

2

這是一個造型問題。使用瀏覽器開發人員工具(大多數瀏覽器中的F12)選擇要設置樣式的節點。在Chrome中,您也可以右鍵單擊節點並選擇「檢查」。

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

然後創建一些自定義樣式。根據您的模板,你可能最終的東西,如:

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

參見:

+0

但對於這個工作,你需要給「容器」,其中'.ui-paginator'生活在一個固定的高度,否則它仍然是不變的? – Kukeltje

+0

@Kukeltje對我來說這是工作。但是,這可能取決於其他造型。 –