views:

2056

answers:

2

Hi,

I'm using the displaytag JSP tag library to generate tables that show column totals. For example in the JSP code below, only those columns with the attribute total="true" will have totals generated.

<display:table name="myTable" id="myTable" decorator="org.displaytag.decorator.TotalTableDecorator">
    <display:column property="name" title="Name" />
    <display:column property="description" title="Description" />

    <display:column property="openCount" title="Opened" total="true"/>
    <display:column property="revenueTotal" title="Commission" total="true"/>
</display:table>

The problem is that displaytag places these totals in the final <tr> in the table body, but I need them to be inside the table footer (<tfoot>) instead. Is this possible without post-processing the generated HTML in JavaScript?

Cheers, Don

A: 

Take a look at display:footer (which is how the example @tvanfosson referenced works)

Ken Gentle