简体   繁体   English

Apache MyFaces特立尼达: <tr:column/> 标头中的标头对齐标签 <tr:table/>

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

I'm trying to create simple table with header align to left OR right 我正在尝试创建简单的表头对齐到左侧或右侧

In case of numeric the header should align to right otherwise to left. 如果是数字,则标题应右对齐,否则应左对齐。

This is my code: 这是我的代码:

<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>

The output from my code is that the column rows are align correctly right or left as I wanted BUT the column headers are not being align to right, just to left. 我的代码的输出是,列行正确地向右或向左对齐,但我希望列标题没有向右对齐,而只是向左对齐。

My question is how can I make the column header to be align to right as well. 我的问题是如何使列标题也与右边对齐。

In the example above I need that the header File Size will be align to rigth 在上面的示例中,我需要标题文件大小与对齐对齐

Thanks, 谢谢,

John. 约翰。

You can use align attribute of tr:column . 您可以使用tr:column align属性。

Example : 范例:

<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