Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 JSF panelGrid,其中没有列是动态的,在这种情况下,我应该如何在 css 中声明列类?
<h:panelGrid id="testpanel" columns="#{message.no_of_columns}" rows="#{message.no_of_rows}" columnClasses="">
我希望所有列都具有相同的 css 样式。
谢谢。
生成一个逗号分隔的字符串,其中包含与列数一样多的项目:
<h:panelGrid ... columnClasses="#{message.columnClasses}">
或者重新定义样式,以便可以在表格级别应用:
<h:panelGrid ... styleClass="dynamicGrid">
和
.dynamicGrid td { /* Put the original CSS here, it'll get applied to every column. */ }