与&lt对齐元素; H:panelGrid的/>元素、lt、GT、panelGrid

2023-09-11 07:51:07 作者:你就是我的咒語

我要为显示在下面的图片对齐元素。

I want to align elements as shown in the following image.

有2列。之一对准到左母体的和彼此对准到右。 我不想指定像素或EM东西。在我如何做到这一点< H:panelGrid的/>

There are 2 columns. One aligned to left of the parent and another aligned to right. I dont want to specify anything in px or em. How do I achieve this in <h:panelGrid /> ?

推荐答案

使用CSS。

<h:panelGrid columns="2" columnClasses="column1,column2">
    ...
</h:panelGrid>

.column1 {
    width: 50%;
    text-align: left;
}

.column2 {
    width: 50%;
    text-align: right;
}

参见:

CSS教程

See also:

CSS tutorial