Creating Accordion Table with Bootstrap

后端 未结 3 1791
长发绾君心
长发绾君心 2020-12-13 02:14

I have a table that\'s populated from a database which has lots of columns (around 30). A solution someone thought of was to create an accordion out the table, where each ro

3条回答
  •  天命终不由人
    2020-12-13 02:59

    For anyone who came here looking for how to get the true accordion effect and only allow one row to be expanded at a time, you can add an event handler for show.bs.collapse like so:

    $('.collapse').on('show.bs.collapse', function () {
        $('.collapse.in').collapse('hide');
    });
    

    I modified this example to do so here: http://jsfiddle.net/QLfMU/116/

提交回复
热议问题