如何在jsf中为h:panelgrid指定样式

时间:2015-05-09 06:50:19

标签: css jsf jsf-2

我使用简单的h:panelGrid来显示表格如何为表格指定样式以使其更好。我对网上看到的所有东西都有些困惑 这就是我一直在使用的代码

<h:panelGrid id="panel" columns="2"  cellpadding="10"
            cellspacing="1" style="align:center;">
            <f:facet name="header">
                <h:outputText value="Registration" />
            </f:facet>
            <h:outputText value="User Name:" escape="false" />
        <h:inputText value="Hello World" />
            <h:outputText value="Password:" escape="false" />
            <h:inputSecret value="" />
        </h:panelGrid>

是否可以指定用于指定jsf中元素的css或内联样式的可选optons列表 提前致谢

1 个答案:

答案 0 :(得分:0)

不要尝试使用内联样式。由于jsf在这方面是一个html代码生成器,因此内联样式不适用于您希望它们应用于的html元素。使用styleClass属性,使用正确的选择器为要设置样式的html元素创建css。在这些选择器中使用apllied类

另见

相关问题