Accordion effect and only allow one row to be expanded at a time, an event handler for show.bs.collapse can be added like so:
HTML:
<table class="table table-condensed" style="border-collapse:collapse;">
<thead>
<tr>
<th>#</th>
<th>Date</th>
<th>Description</th>
<th>Credit</th>
<th>Debit</th>
<th>Balance</th>
</tr>
</thead>
<tbody>
<tr data-toggle="collapse" data-target=".demo1">
<td>1</td>
<td>05 May 2013</td>
<td>Credit Account</td>
<td class="text-success">$150.00</td>
<td class="text-error"></td>
<td class="text-success">$150.00</td>
</tr>
<tr>
<td class="hiddenRow">
<div class="collapse demo1">Demo1</div>
</td>
<td class="hiddenRow">
<div class="collapse demo1">Demo1</div>
</td>
<td class="hiddenRow">
<div class="collapse demo1">Demo1</div>
</td>
<td class="hiddenRow">
<div class="collapse demo1">Demo1</div>
</td>
<td class="hiddenRow">
<div class="collapse demo1">Demo1</div>
</td>
<td class="hiddenRow">
<div class="collapse demo1">Demo1</div>
</td>
</tr>
<tr data-toggle="collapse" data-target="#demo2">
<td>2</td>
<td>05 May 2013</td>
<td>Credit Account</td>
<td class="text-success">$11.00</td>
<td class="text-error"></td>
<td class="text-success">$161.00</td>
</tr>
<tr>
<td colspan="6" class="hiddenRow">
<div id="demo2" class="collapse">Demo2</div>
</td>
</tr>
<tr data-toggle="collapse" data-target="#demo3">
<td>3</td>
<td>05 May 2013</td>
<td>Credit Account</td>
<td class="text-success">$500.00</td>
<td class="text-error"></td>
<td class="text-success">$661.00</td>
</tr>
<tr>
<td colspan="6" class="hiddenRow">
<div id="demo3" class="collapse">Demo3</div>
</td>
</tr>
</tbody>
</table>
JQUERY:
$('.collapse').on('show.bs.collapse', function () {
$('.collapse.in').collapse('hide');
});
JS Fiddle: http://jsfiddle.net/QLfMU/116/
Credits goes to: https://stackoverflow.com/users/4186945/hackel
Orginal Posted answer by Hackel: https://stackoverflow.com/questions/16389775/twitter-bootstrap-use-collapse-js-on-table-cells-almost-done
HTML:
<table class="table table-condensed" style="border-collapse:collapse;">
<thead>
<tr>
<th>#</th>
<th>Date</th>
<th>Description</th>
<th>Credit</th>
<th>Debit</th>
<th>Balance</th>
</tr>
</thead>
<tbody>
<tr data-toggle="collapse" data-target=".demo1">
<td>1</td>
<td>05 May 2013</td>
<td>Credit Account</td>
<td class="text-success">$150.00</td>
<td class="text-error"></td>
<td class="text-success">$150.00</td>
</tr>
<tr>
<td class="hiddenRow">
<div class="collapse demo1">Demo1</div>
</td>
<td class="hiddenRow">
<div class="collapse demo1">Demo1</div>
</td>
<td class="hiddenRow">
<div class="collapse demo1">Demo1</div>
</td>
<td class="hiddenRow">
<div class="collapse demo1">Demo1</div>
</td>
<td class="hiddenRow">
<div class="collapse demo1">Demo1</div>
</td>
<td class="hiddenRow">
<div class="collapse demo1">Demo1</div>
</td>
</tr>
<tr data-toggle="collapse" data-target="#demo2">
<td>2</td>
<td>05 May 2013</td>
<td>Credit Account</td>
<td class="text-success">$11.00</td>
<td class="text-error"></td>
<td class="text-success">$161.00</td>
</tr>
<tr>
<td colspan="6" class="hiddenRow">
<div id="demo2" class="collapse">Demo2</div>
</td>
</tr>
<tr data-toggle="collapse" data-target="#demo3">
<td>3</td>
<td>05 May 2013</td>
<td>Credit Account</td>
<td class="text-success">$500.00</td>
<td class="text-error"></td>
<td class="text-success">$661.00</td>
</tr>
<tr>
<td colspan="6" class="hiddenRow">
<div id="demo3" class="collapse">Demo3</div>
</td>
</tr>
</tbody>
</table>
JQUERY:
$('.collapse').on('show.bs.collapse', function () {
$('.collapse.in').collapse('hide');
});
JS Fiddle: http://jsfiddle.net/QLfMU/116/
Credits goes to: https://stackoverflow.com/users/4186945/hackel
Orginal Posted answer by Hackel: https://stackoverflow.com/questions/16389775/twitter-bootstrap-use-collapse-js-on-table-cells-almost-done