Multi-rows Footer
Multi-rows Footer
ngungo
Posts: 64Questions: 23Answers: 2
Test case: http://cochin.us/foo
I have read everything in this forum about multi-row issue including: https://www.datatables.net/forums/discussion/16866/how-can-we-have-multiple-rows-in-the-footer-of-a-datatable
I do put the column total into the 1st row cell but I need to put this total into the second row instead. My question is how do I put the column total into the second row cell of footer.
Thanks,
ngungo
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I have not found way to put the column totals into second row cells so I improvised by output to multi-lines cell using html line break element <br>. It is not too bad and I have to move แปn :)
Thanks for reading.
You would use something like:
$('tr:eq(1) td:eq(...)', table.table().footer())
. i.e. select the second row from the footer and then select whatever cell it is that you need.Allan
Hi Allan,
. Can you give me a ref link to
$('tr:eq(1) td:eq(...)', table.table().footer())
, please.. When use, I got an error: Cannot read property 'table' of undefined
Of course, because the "footerCallback" is inside of "table"
Basically, I have some like this:
ngungo
table().footer()
is the DataTables API method I mentioned. The full, searchable API is available here.In your code above you would probably access it as
api.table().footer()
as you have done for the other API methods in your callback function.Allan
We are getting somewhere. No longer error but still not working. No display.
I'll work some more on this.
I'd need a link to the page showing the issue to be able to understand why it isn't working please.
Allan
Here is the link: Test case
Thanks Allan!
There are no
td
cells in your footer - they areth
cells :-). If you just change the selectors on lines 10-12 in the above code they should work as expected.Allan
Beautiful.
Lesson learned.
Thank you very much.