在JSF Datatables-Codedrop-Weblog中更改头类(CSS)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在JSF Datatables-Codedrop-Weblog中更改头类(CSS)相关的知识,希望对你有一定的参考价值。
Something I have always found annoying about JSF datatables is the limitation to only apply one header class style to the entire table. This is un-functional for datatables that would display monetary amount or other data that is typically right aligned whereas descriptive columns are left aligned. The table doesn’t look very nice if the heading don’t match the columns.
<h:panelGrid width=â€100%†id=â€memberTransactionTableBody†border=â€0″ cellspacing=â€0″ cellpadding=â€0″ columns=â€1″> <h:column> <h:form id=â€formâ€> <h:dataTable rowClasses=â€accountTransactionRowDefault, accountTransactionRowAlternate†headerClass=â€accountColumnHeader StrongText†footerClass=â€accountColumnFooter†width=â€100%†cellpadding=â€0″ cellspacing=â€0″ border=â€0″ columnClasses=â€account-padding,account-date,account-description,account-debit, account-credit,account-currency,account-status†styleClass=â€accountTransactionText†var=â€transaction†value=â€#{transactionHandler.transactionBean.transactionHistory}†rows=â€40″> <h:column> </h:column> <h:column> <f:facet name=â€headerâ€> <div style=â€float: left;â€> #{messages['message.account.column.date']} </div> </f:facet> <h:outputText value=â€#{transaction.dateTimeStamp}â€/> <f:facet name=â€footerâ€> </f:facet> </h:column> <h:column> <f:facet name=â€headerâ€> <div style=â€float: left;â€> #{messages['message.account.column.description']} </div> </f:facet> <h:outputText value=â€#{transaction.description}â€/> </h:column> <h:column> <f:facet name=â€headerâ€> #{messages['message.account.column.debit']} </f:facet> <h:outputText value=â€#{transaction.debit}â€/> </h:column> <h:column> <f:facet name=â€headerâ€> #{messages['message.account.column.credit']} </f:facet> <h:outputText value=â€#{transaction.credit}â€/> </h:column> <h:column> <f:facet name=â€headerâ€> #{messages['message.account.column.currency']} </f:facet> <h:outputText value=â€#{transaction.currency}â€/> </h:column> </h:dataTable> </h:form> </h:column> </h:panelGrid>
以上是关于在JSF Datatables-Codedrop-Weblog中更改头类(CSS)的主要内容,如果未能解决你的问题,请参考以下文章
在 JSF 1.2 中使用 Mojarra 配置 JSF 视图状态加密
在同一个 Tomcat 服务器上部署 JSF 1.2 和 JSF 2.0 应用程序