How to force footer generation

How to force footer generation

Soul ReaverSoul Reaver Posts: 3Questions: 1Answers: 0

I am trying to build an array with columns/columnDefs options. When I setup title parameter, thead block gets automatically generated. Is there a way to force generation of footer row as well?

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Hi @Soul Reaver ,

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • Soul ReaverSoul Reaver Posts: 3Questions: 1Answers: 0
    edited May 2019

    Yes, ofc, this could be used as an example: http://live.datatables.net/ruxodeli/5/
    Simple 3 column table, with columns defined through javascript table passed as parameter to DataTables instead of original DOM table (thead/tfoot) structure. With that, header row gets automatically generated and appended to the data table. I want to automatically add footer as well.

    I know I can do that easily by adding thead and tfoot in the HTML, but actual table will have about 40-50 columns and I don't want to fight with both header and footer when I'd like to edit anything. I have an idea for workaround - use columns object to generate DOM nodes myself, then create DataTable object, but that's just a workaround.

  • colincolin Posts: 15,112Questions: 1Answers: 2,583
    Answer ✓

    Hi @Soul Reaver ,

    Thanks for that, it helped understand the issue. These two SO threads here and here may help, they're discussing the same thing with various solutions.

    Hopefully one of those will do the trick,

    Cheers,

    Colin

  • Soul ReaverSoul Reaver Posts: 3Questions: 1Answers: 0

    Yes thank you.

    Basic information that DT does not have such auto-footer option (no wonder I did not find it myself) would be enough, but adding a bunch of empty cells in footer probably is better than applying text myself (I am guessing that DT would update it anyway). ^_^

This discussion has been closed.