Dynamic Rowspan

Dynamic Rowspan

nsuarezvalderramansuarezvalderrama Posts: 3Questions: 1Answers: 0
edited November 2020 in Free community support

Hi, has anyone managed to draw dynamic rowspan in DataTable?

Answers

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

    The HTML requirements docs state this:

    Please also note that while DataTables supports colspan and rowspan in the table's header and footer, they are not supported in the table's tbody and must not be present.

    Kevin

  • nsuarezvalderramansuarezvalderrama Posts: 3Questions: 1Answers: 0

    Thanks kthorngren, but that is the problem, I need rowspan in the tbody and don't find a way for solve that problem,

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

    Maybe we can offer alternatives. What are you trying to do with the rowspan? Maybe you can build a non-datatable example of what you are trying to do.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Datatables expects a one-to-one mapping of cells in the rows and columns to perform the Datatables functions like sorting and searching. This is why rowspan and colspan aren't supported in the tbody.

    Kevin

  • nsuarezvalderramansuarezvalderrama Posts: 3Questions: 1Answers: 0

    I want something like this but number of rowspan are dynamic, no always is the same number.

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

    Yep, colspan isn't supported - see the manual:

    Please also note that while DataTables supports colspan and rowspan in the table's header and footer, they are not supported in the table's tbody and must not be present.

    Colin

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

    Maybe the RowGroup extension will do what you want.

    Kevin

This discussion has been closed.