How can I add another column datatable

How can I add another column datatable

sapatossapatos Posts: 3Questions: 2Answers: 0

Hi. how can I add columns I already 5 columns but having problem with table footer for the sum.

Thank you.

Answers

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    Hi @sapatos ,

    You cannot add additional columns once the table has been initialised. You can destroy() and recreate the table again once the column has been added to the DOM.

    Cheers,

    Colin

  • sapatossapatos Posts: 3Questions: 2Answers: 0

    Hi Colin,

    So i'm only limited to 5 columns?anyway, thank you very much for the reply.

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    Hi @sapatos ,

    No, you're limited to the number of columns that were there when you initialise DataTables. If you add more to the DOM afterwards, as I said, you can reinitialise with either destroy or destroy(),

    Cheers,

    Colin

  • kthorngrenkthorngren Posts: 20,300Questions: 26Answers: 4,769

    how can I add columns I already 5 columns but having problem with table footer for the sum.

    Is the question regarding the ability to sum more than one column based on this example?
    https://datatables.net/examples/advanced_init/footer_callback.html

    I don't think we are understanding your question. Please provide more detail of what you want to do.

    Kevin

This discussion has been closed.