在表内使用Bootstrap 3弹出窗口时,如果希望按钮顶部不显示,可以通过以下步骤实现:
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<table>
<tr>
<td>
<button type="button" class="btn btn-primary" id="myButton">点击弹出窗口</button>
</td>
</tr>
</table>
<script>
$(document).ready(function() {
$('#myButton').click(function() {
$('#myModal').modal('show');
});
});
</script>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">弹出窗口标题</h4>
</div>
<div class="modal-body">
弹出窗口内容
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary">保存</button>
</div>
</div>
</div>
</div>
通过以上步骤,你可以在表内使用Bootstrap 3弹出窗口,并且按钮顶部不会显示其他内容。
领取专属 10元无门槛券
手把手带您无忧上云