JSF panelgrid对齐到顶部 [英] JSF panelgrid alignment to top

查看:116
本文介绍了JSF panelgrid对齐到顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到有一些为此发布的答案。尝试几乎所有的人与几个排列组合..但似乎没有工作。



panelgris中的组件总是中间对齐,而不是顶部。



尝试了以下帖子中的任何内容。
如何控制DataTable内部的对齐a PanelGrid?



请告诉我是否有补救措施。

解决方案

< h:panelGrid> 呈现HTML < table> 元素。表单元格< td> 的垂直对齐默认为 middle 。你想让它顶部。这很容易与CSS。

 < h:panelGrid styleClass =foo> 

  .foo td {
vertical-align:top;
}

如果您要在其中保留一个表格默认表格单元格垂直对齐中间,那么你需要改变CSS如下:

  .foo> tbody> tr> td {
vertical-align:top;
}

,因此只有panelgrid自己的表格单元格顶部对齐。

要了解CSS的所有信息,请检查 http://www.csstutorial.net 。 p>

I see there are some answers posted for this. tried almost all of them with several permutation-combination.. but nothing seems to be working.

components inside panelgris are always middle aligned, instead of top.

tried whatever they said in the below post. How to control alignment of DataTable inside of a PanelGrid?

Please let me know if there is a remedy.

解决方案

The <h:panelGrid> renders a HTML <table> element. The vertical alignment of a table cell <td> defaults indeed to middle. You want to make it to be top instead. This is easy with CSS.

<h:panelGrid styleClass="foo">

with

.foo td {
    vertical-align: top;
}

If you have a table inside the panelgrid for which you'd like to keep the default table cell vertical alignment of middle, then you need to alter the CSS as follows:

.foo>tbody>tr>td {
    vertical-align: top;
}

so that only the panelgrid's own table cells are top aligned.

To learn all about CSS, check http://www.csstutorial.net.

这篇关于JSF panelgrid对齐到顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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