0

我想在 h:panelGrid 中设置一行的高度。

我怎样才能做到这一点?

这是我的CSS类:

.height8 {
    height: 8px;
}

.height0 tr td{
    height: 0%
}

页面代码:

<h:panelGrid columns="2" columnClasses="height8, height8" rowClasses="height8">
    <h:outputText value="This row"/>
    <h:outputText value=" is ok"/>

    <h:outputText value="This row"/>
    <h:outputText value=" is ok"/>

    <h:outputText value="This row" styleClass="height0"/>
    <h:outputText value=" height should be different" styleClass="height0"/>

    <h:outputText value="This row"/>
    <h:outputText value=" is ok"/>
</h:panelGrid>

样式类 height0 似乎在这里不起作用。如何在 h:panelGrid 中设置特定行的高度?

4

2 回答 2

0

你有两种方法:

内联样式:

<h:outputText value="This row"/>
<h:outputText value=" is ok"/>

<h:outputText value="This row" style="height: 25px"/>
<h:outputText value=" is ok" style="height: 25px"/>

<h:outputText value="This row"/>
<h:outputText value=" is ok"/>

CSS 样式:

你的元素应该有一个id:

<h:outputText value="This row"/>
<h:outputText value=" is ok"/>

<h:outputText value="This row" id="customheight"/>
<h:outputText value=" is ok" id="customheight"/>

<h:outputText value="This row"/>
<h:outputText value=" is ok"/>

并在您的 CSS 文件中添加此样式:

#customheight{
   height: 25px;
}
于 2013-10-29T11:00:28.167 回答
-1

更改以下样式类应该可以

.height0 tr td{
    height: 0px; //or what ever height you want to set to this row.
}
于 2013-10-29T10:42:45.993 回答