设置 jsf 数据表中最后一条记录的样式
我遇到的情况是,我的数据多于返回到 dataTable 元素的单行所能容纳的数据。为了解决这个问题,我只是将结果合并到一个单元格中。我正在寻找一种方法来确定我是否已到达结果集中的最后一个对象,以便我可以删除用作分隔符的底部边框。最终我不知道我将处理多少对象。
.most {
background-color:cyan;
border-bottom:medium solid black;
}
.last {
border-bottom:none;
}
<h:dataTable id="myTable" value="#{flowData.selectedItem.profile}" var="profile" columnClasses="most, last">
<h:column>
<h:inputText id="_last" value="#{profile.last}" />
<h:inputText id="_first" value="#{profile.first}" />
<h:inputText id="_middle" value="#{profile.middle}" />
<h:inputText id="_city" value="#{profile.city}" />
<h:inputText id="_state" value="#{profile.state}" />
</h:column>
</h:dataTable>
预先感谢您的任何意见。
I have a situation where I have more data than can be accommodated in a single row being returned to a dataTable element. In order to deal with this I have simply combined the results into a single cell. What I am looking for is a way to determine whether or not I have reached the last object in the result set so that I can drop the bottom-border used as my separator. Ultimately I do not know how many objects I will be dealing with.
.most {
background-color:cyan;
border-bottom:medium solid black;
}
.last {
border-bottom:none;
}
<h:dataTable id="myTable" value="#{flowData.selectedItem.profile}" var="profile" columnClasses="most, last">
<h:column>
<h:inputText id="_last" value="#{profile.last}" />
<h:inputText id="_first" value="#{profile.first}" />
<h:inputText id="_middle" value="#{profile.middle}" />
<h:inputText id="_city" value="#{profile.city}" />
<h:inputText id="_state" value="#{profile.state}" />
</h:column>
</h:dataTable>
Thanks in advance for any input.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这取决于您想要支持的 IE 浏览器版本。
如果您不关心 IE6/7 支持,那么您可以使用 CSS2
:last-child
伪类来实现此目的。(是的,IE7 支持 CSS2 伪类对应
:first-child
,但它确实不支持:last-child
!)如果您关心 IE7,但不关心 IE6,那么您也可以反过来,用
border-top
而不是border-bottom
代码> 设置为none
on:first-child
:如果您也关心 IE6(即 现在是可讨论的),那么您就无法在托管 bean 中自己生成行类(不是列类!)的字符串。
和
这个CSS
That depends on the IE browser version which you'd like to support.
If you don't care about IE6/7 support, then you could use the CSS2
:last-child
pseudoclass for this.with
(yes, IE7 supports the CSS2 pseudoclass counterpart
:first-child
, but it does really not support the:last-child
!)If you care about IE7, but not about IE6, then you can also do it the other way round, with a
border-top
instead ofborder-bottom
which is set tonone
on:first-child
:If you however also care about IE6 (which is discutable these days), then you can't go around generating the string of row classes (not column classes!) youself inside the managed bean.
with
and this CSS