0
我有一個表,與摺疊的項目,我想只允許一個顯示在一次,像這裏http://jsfiddle.net/s4je5b0y/,但我無法找到如何做一個表。 我看到有一個類的數據父,但我不能在表中使用它,不知道爲什麼。 謝謝。bootstrap表崩潰只允許一個在時間打開
我的代碼:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<table class='table table-bordered table-condensed' style='border-collapse:collapse;background-color:white;'>
\t \t \t \t \t <thead>
\t \t \t \t \t \t <tr>
\t \t \t \t \t \t \t <th>a</th>
\t \t \t \t \t \t \t <th>b</th>
\t \t \t \t \t \t \t <th>c</th>
\t \t \t \t \t \t </tr>
\t \t \t \t \t </thead>
\t \t \t \t \t <tbody>
\t \t \t \t \t \t <tr id='open0' data-target='#r0' class='accordion-toggle' data-toggle='collapse'>
\t \t \t \t \t \t \t <td>0</td>
\t \t \t \t \t \t \t <td></td>
\t \t \t \t \t \t \t <td>2</td>
\t \t \t \t \t \t </tr>
\t \t \t \t \t \t <tr style='background-color:#e5e8e7;'>
\t \t \t \t \t \t \t <td colspan='5' class='hiddenRow'>
\t \t \t \t \t \t \t \t <div class='collapse ' id='r0'>
\t \t \t \t \t \t \t \t \t asd
\t \t \t \t \t \t \t \t </div>
\t \t \t \t \t \t \t </td>
\t \t \t \t \t \t </tr>
\t \t \t \t \t \t <tr id='open1' data-target='#r1' class='accordion-toggle' data-toggle='collapse'>
\t \t \t \t \t \t \t <td>0</td>
\t \t \t \t \t \t \t <td></td>
\t \t \t \t \t \t \t <td>2</td>
\t \t \t \t \t \t </tr>
\t \t \t \t \t \t <tr style='background-color:#e5e8e7;'>
\t \t \t \t \t \t \t <td colspan='5' class='hiddenRow'>
\t \t \t \t \t \t \t \t <div class='collapse ' id='r1'>
\t \t \t \t \t \t \t \t \t asd
\t \t \t \t \t \t \t \t </div>
\t \t \t \t \t \t \t </td>
\t \t \t \t \t \t </tr>
\t \t \t \t \t \t <tr id='open1' data-target='#r2' class='accordion-toggle' data-toggle='collapse'>
\t \t \t \t \t \t \t <td>0</td>
\t \t \t \t \t \t \t <td></td>
\t \t \t \t \t \t \t <td>2</td>
\t \t \t \t \t \t </tr>
\t \t \t \t \t \t <tr style='background-color:#e5e8e7;'>
\t \t \t \t \t \t \t <td colspan='5' class='hiddenRow'>
\t \t \t \t \t \t \t \t <div class='collapse ' id='r2'>
\t \t \t \t \t \t \t \t \t asd
\t \t \t \t \t \t \t \t </div>
\t \t \t \t \t \t \t </td>
\t \t \t \t \t \t </tr>
\t \t \t \t \t </tbody>
\t \t \t \t </table>
???我想添加數據目標到我的表,而不是從示例中刪除它! –