Collapse entire table to header

Collapse entire table to header

colomborodrigocolomborodrigo Posts: 2Questions: 1Answers: 0

I want to collapse all rows into header like you can collapse a row in https://datatables.net/examples/api/row_details.html and I cant find a way to do it.
Any ideas?

Thanks in advance

This question has an accepted answers - jump to answer

Answers

  • crwdzrcrwdzr Posts: 31Questions: 5Answers: 6
    Answer ✓

    do you mean make it so only the table head and/or table foot are visible with no rows showing up in the actual body? if so, you could simply do something like:

    $('#mytable>tbody').css('display', 'none'), or animate it with .fadeIn() and .fadeOut()

  • colomborodrigocolomborodrigo Posts: 2Questions: 1Answers: 0

    Thank you! I did not think of this while doing it.
    This solved the issue.

  • TyagiTyagi Posts: 11Questions: 3Answers: 0

    Hi everyone,
    I have same issues regarding collapse but I want to show only one child table when i click on image (+) button.

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @Tyagi ,

    This example from this thread shows how opened child rows are closed so only one is open at any time,

    Hope that helps,

    Cheers,

    Colin

  • TyagiTyagi Posts: 11Questions: 3Answers: 0

    Thanks colin.
    I am stuck before 2 days .Now My issues solved.Thanks a lot..

This discussion has been closed.