gpt4 book ai didi

css - 将 css 样式添加到 JSFpanelGrid 中的动态列类

转载 作者:太空宇宙 更新时间:2023-11-04 05:02:06 25 4
gpt4 key购买 nike

我有 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. */
}

关于css - 将 css 样式添加到 JSFpanelGrid 中的动态列类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11291111/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com