簡體   English   中英

Apache MyFaces特立尼達: <tr:column/> 標頭中的標頭對齊標簽 <tr:table/>

[英]Apache MyFaces Trinidad: <tr:column/> header Alignment tags inside a <tr:table/>

我正在嘗試創建簡單的表頭對齊到左側或右側

如果是數字,則標題應右對齊,否則應左對齊。

這是我的代碼:

<tr:treeTable width="700px" var="file" value="#{bean.files}">
<tr:column>
    <f:facet name="header" >
        <tr:outputText value="File Name"/>
    </f:facet>
    <tr:outputText value="#{file.fileName}"/>
</tr:column>
<tr:column inlineStyle="text-align:right">
    <f:facet name="header" >
        <tr:outputText value="File Size"/>
    </f:facet>
    <tr:outputText value="#{file.size}"/>
    <tr:convertNumber type="number"/>
</tr:column>

我的代碼的輸出是,列行正確地向右或向左對齊,但我希望列標題沒有向右對齊,而只是向左對齊。

我的問題是如何使列標題也與右邊對齊。

在上面的示例中,我需要標題文件大小與對齊對齊

謝謝,

約翰。

您可以使用tr:column align屬性。

范例:

<tr:column align="right" headerText="File Name">
    <tr:outputText value="#{file.fileName}"/>
</tr:column>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM