Getting sum show up under column
Getting sum show up under column

I have a basic setup that I added sum() to based on this: https://datatables.net/plug-ins/api/sum()#Examples
How do I make the sum show up under the column? It seems like it's part of the table now so adding a footer didn't help.
Thank you.
Agnes
This discussion has been closed.
Answers
This example shows how to provide sums in the footer:
https://datatables.net/examples/advanced_init/footer_callback.html
Kevin
I tried that but couldn't get it formatted.
Aka I couldn't get either show up properly.
Make sure you have a -tag tfoot` defined in your HTML. If this doesn't help then please provide a test case showing what you are trying to do so we can help.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
I can't provide a webpage since I implemented this in FileMaker.
Please ignore the extra quotes in the code, since they are needed for FileMaker:
Edited by Kevin: Syntax highlighting. Details on how to highlight code using markdown can be found in this guide
I took your HTML table and built a test case for you:
http://live.datatables.net/qucuhobi/1/edit
I took the sum() example you linked to and performed the sum of column 3. the example overwrote the footer so I changed
$( api.table().footer() ).html(...)
to$( api.column(3).footer() ).html(...)
to place the sum for column 3 in the footer of column 3.I also added the FooterCallback example for column 4.
They both work, its your choice of which to use. If you still have difficulties please update the test case to show the problem.
Kevin