在文档中声明引导模式元素:
<div id="result-modal" class="modal hide fade" style="display:none">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">× </button>
<h3>Modal header</h3>
</div>
<div class="modal-body">
<table class="table">
<thead>
<tr>
<th>head1</th>
<th>head1</th>
.....
</tr>
</thead>
<tbody>
<tr id="result-content">
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<a href="#" class="btn">Close</a>
</div>
</div>
然后修改你的javascript代码:
$('.more-detail').click(function(){
var row = $(this).parent().parent();
var data = [];
$("#result-content").empty();
$(row).find('td').not(0).each(function(){
data.push($(this).text());
$("#result-content").append($(this).clone());
});
$('#result-modal').modal();
console.log(data);
});
希望这对你有帮助。