【问题标题】:Primefaces: Right align Exporters on table headerPrimefaces:在表头上右对齐导出器
【发布时间】:2015-03-06 07:48:47
【问题描述】:

我将 p:dataTable 的 paginatorTemplate 声明为:

<p:dataTable id="lazyDataTable" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}">

声明“出口商”:

<f:facet name="{Exporters}">
    <h:commandLink>
        <p:graphicImage libray ="images" name="excel.png"/>
        <p:dataExporter type = "xls" target="lazyDataTable" fileName="report" />
    </h:commandLink>
    <h:commandLink>
        <p:graphicImage library="images" name="pdf.png"/>
        <p:dataExporter type = "pdf" target="lazyDataTable" fileName="report" />
    </h:commandLink>
</f:facet>

我希望导出器与表头右对齐,但它出现在表头的中间,如下所示:

如何将其对齐到标题的右侧,谢谢!

【问题讨论】:

    标签: primefaces datatable exporter


    【解决方案1】:

    表头中的数据导出器被包装在&lt;a /&gt;-tag 中,因此您可以通过 CSS 对齐导出器的位置,如下所示:

    /*  data-exporter symbol shown in the upper right
        corner of the datatable */
    
    .ui-paginator a, .exporter .ui-datatable-header a {
        float: right;
        margin-right: 5px;
    }
    

    【讨论】:

    • 最后都是html、css、javascript。因此,使用浏览器开发工具,这些东西很容易找到
    猜你喜欢
    • 2013-05-09
    • 2023-03-24
    • 1970-01-01
    • 2012-09-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-21
    相关资源
    最近更新 更多