jsf - 在 panelGrid 列中对齐内容

标签 jsf richfaces primefaces

如何将 panelGrid 组件创建的列中的内容与 top 对齐?

我试了没有成功,下面的代码

<h:panelGrid columns="2" style="vertical-align:top;  " >
       <p:tabView style="margin:0px 0px 50px 0px; width: 450px; padding-top: 0px;vertical-align:top" ></p:tabView>                
       <p:menubar autoSubmenuDisplay="true" style="width: 300px; vertical-align:top" ></p:menubar>
</h:panelGrid>

但是由此创建的 2 列仍然保持垂直居中对齐。

最佳答案

基于 this回答,你可以这样做(我最喜欢这种方法)

<h:panelGrid columnClasses="className">

.className {
    vertical-align: top;
}

关于jsf - 在 panelGrid 列中对齐内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6326983/

相关文章:

css - primefaces 子表 styleClass

java - Primefaces p :menuitem pass an attributes to actionListener

jsf - 未找到 FacesContext

ajax - 将 Spring Security 与 Ajax 调用集成

java - 子 selectOneMenu JSF 1.2 的错误填充值

java - JSF2 Richfaces 4.1.0 Ajax 局部渲染树

javascript - 更改 Primefaces 思维导图中节点的显示

javascript - JSF 2.0 javascript onload/oncomplete

java - 为什么我的h :message for a specific id not displaying correctly in my dynamic form?更多在描述

java - CVE-2018-14667;为 RichFaces 3.X 生成有效负载