Can I add the footers of different tables?
Can I add the footers of different tables?
NkNoctafly
Posts: 10Questions: 5Answers: 0
in DataTables
good day,I would like to know how I can add the footers of different tables and store the result in another table
like this :
This question has an accepted answers - jump to answer
Answers
I would look at doing this in the
footerCallback
of each table. In thefooterCallback
total the values of all the footer cells you want than place it in the table you want. I would make this a function and just call it as the last statement in thefooterCallback
.Kevin
and how could you subtract two footer and put it in another footer like this?
Use a jquery selector to select the footer
th
you want from each footer. Then use jquery text() API or jquery html() API to get the content of theth
. Do the calculation and place it where you want. Except for doing this infooterCallback
there is nothing specific to Datatables to accomplish this. However if you want help please provide a simple test case showing what you have so we can provide more specific help.https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin