expand/collapse table rows with JQuery

后端 未结 7 984
闹比i
闹比i 2020-11-27 11:09

I want to expand and collapse table rows when header columns is clicked. I only want to expand/collapse rows which are under the specific header (clicked).

Here is m

7条回答
  •  眼角桃花
    2020-11-27 11:43

    A JavaScript accordion does the trick.

    This fiddle by W3Schools makes a simple task even more simple using nothing but javascript, which i partially reproduce below.

    
    
    
    
    ...
    
    

    Lorem ipsum dolor sit amet

    ...

    ...

    ...

    Lorem ipsum dolor sit amet

    ...
    ...

    if using php, don't forget to convert " to '. You can also use tables of data inside the button and it will still work.

提交回复
热议问题