2013-11-02 64 views
0

我怎麼能用p:dataTable primefaces showcase做那種表。我希望列名和行名始終保持穩定,只有表中的數據可以更改。
p:dataTable實線行名jsf

我的表圖片:

enter image description here

回答

0

例如,下面是簡單的dataTable代碼。如果您想要灰色標題,您可以在CSS或樣式參數中調整樣式。

<p:dataTable id="dataTable" var="car" value="#{tableBean.carsSmall}"> 

<p:column style="background-color: grey"> 
    <h:outputLabel>row name</h:outputLabel> 
</p:column> 

    <p:column headerText="column name"> 
    </p:column> 

<p:column headerText="column name"> 
    </p:column> 

<p:column headerText="column name"> 
    </p:column> 
</p:dataTable> 
+0

這是非常有益的,但我怎麼可以添加幾個行名稱 與列,一個在另一個之下?當我寫這樣的代碼: 「行名稱 行名稱 ' 一切都在一條線上。 – Johnnie