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

时间:2021-02-28 20:01:12

I using a simple h:panelGrid for displaying the table how could i specify styles for the table to make it better. i am a bit confused with all the stuff i looked online This is what the code that i have been using

我使用一个简单的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>

Could you please specify the list of opssible optons for specifying the css or inline styles for elements in jsf Thanks in advance

你能否指定用于指定jsf中元素的css或内联样式的可选optons列表在此先感谢

1 个解决方案

#1


Don't try to use inline styles. Since jsf is a html code generator in this regard, inline styles ofthen do not apply to the html element you want them applied to. Use the styleClass attribute,and create css with the right selectors for the html elements you want to style. Use the apllied class in those selectors

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

See also

#1


Don't try to use inline styles. Since jsf is a html code generator in this regard, inline styles ofthen do not apply to the html element you want them applied to. Use the styleClass attribute,and create css with the right selectors for the html elements you want to style. Use the apllied class in those selectors

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

See also