Bernad Ali
Bernad Ali

Reputation: 1729

add css Style to dynamic columnclasses in JSFpanelGrid

I have JSF panelGrid which no of columns are dynamic ,in this case how should i declare the columnclasses in css ?

<h:panelGrid id="testpanel" columns="#{message.no_of_columns}" rows="#{message.no_of_rows}" columnClasses="">

I want to have same css style for all the columns.

Thanks.

Upvotes: 0

Views: 1323

Answers (1)

BalusC
BalusC

Reputation: 1108742

Either generate a commaseparated string with as many items as the number of columns:

<h:panelGrid ... columnClasses="#{message.columnClasses}">

Or redefine the style so that it can be applied at table level:

<h:panelGrid ... styleClass="dynamicGrid">

with

.dynamicGrid td {
    /* Put the original CSS here, it'll get applied to every column. */
}

Upvotes: 2

Related Questions