如何在jsf中为h:panelgrid指定样式 [英] How to specify styles for h:panelgrid in jsf

查看:176
本文介绍了如何在jsf中为h:panelgrid指定样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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 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或内联样式的可选opton列表 预先感谢

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

推荐答案

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

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中为h:panelgrid指定样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆